I have created a new calculated column in a table with dates called Simple Projection. Simplified, the calculated column is like this and each date has that value which can be aggregated YTD.
Simple Projection =
VAR a = 10
VAR b = 20
RETURN
a * b
I want to be able to change the variable "a" which is not possible with calculated columns, but is possible with measures. However, when I created the measure with the same equation, it will not aggregate (as you see the total is still 1,298.56 whereas the column total is 472,676.97). I want to get the YTD for the measure, which I do it like this for the column:
Hi @mdatmain ,
You can create another new measure as below and put it on the visual to replace the previous one.
Measure =
SUMX (
GROUPBY (
'Invoked Function',
'Invoked Function'[Date].[Month],
'Invoked Function'[Date].[Day]
),
[Projection Test YTD Forecast]
)
In addition, you can refer the content in the following links to get it.
Power BI Shows Incorrect Measure Total? How to fix it?
Dax for Power BI: Fixing Incorrect Measure Totals
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Best Regards
You cannot aggregate measures. You need to recompute the measure for each "row" in your visual (ie your filter context), and separately for the totals (if present in your visual). Use functions like SUMX to achieve that.