Forum Discussion

mdatmain's avatar
mdatmain
Regular Visitor
5 years ago

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