I am having issues on creating metrics I am getting invalid formula all the time and it’s not adding up to correct number. I found this post before Nov 2025 and it’s exactly the same issue. Attached screenshot.
I believe I’ve found the reason you were seeing the “Invalid Formula” error.
It looks like you’re running into a classic “Data Blend” or “Aggregation” headache in Looker Studio. The “Invalid formula” error in your screenshot is likely happening because you are trying to mix dimensions (like your channel names) with metrics (like Impressions) inside a CASE statement without proper aggregation.
In Looker Studio, once data is blended, fields often become “aggregated.” You cannot compare a raw dimension to a string within a CASE statement if the other result is a metric. To fix the syntax error, try wrapping your dimensions in MAX() or MIN(). This doesn’t change the value (since there’s usually only one channel name per row in this context), but it satisfies Looker Studio’s requirement that all fields in the formula have the same aggregation level.
CASE
WHEN MAX(channelDV) = “DV360” THEN SUM(IFNULL(Impressions (DV), 0))
WHEN MAX(channelFB) = “Meta” THEN SUM(IFNULL(Impressions (Meta), 0))
WHEN MAX(channelTT) = “TikTok” THEN SUM(IFNULL(Impressions (TT), 0))
ELSE 0
END
One small detail to keep in mind: when using a calculated metric like this in a table, you won’t be able to display every individual raw field alongside it simultaneously, as the calculation is designed to aggregate those values into a single result.
I’ve tested this with some demo data, and it’s now calculating the total correctly at 15,500 that is DV total. Let me know if you’d like me to walk you through it! If you want to grand total then you can use this formula:
SUM(IFNULL(Impressions (DV), 0)) +
SUM(IFNULL(Impressions (Meta), 0)) +
SUM(IFNULL(Impressions (TT), 0))