cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

How to aggregate measure like calculated column?

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:

Simple Projection YTD =
CALCULATE(
SUM('Table'[Simple Projection]),
DATESYTD( 'Invoked Function'[Date] )
)

Doing this calculation on the measure will not return anything.

2 REPLIES 2
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User

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.

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.