Forum Discussion
Dynamic Measure calculation using other Dynamic Measures and Filters
- 9 years ago
I am not quite sure why it is working now but somehow it does:
Calc MoM YoY = Calculate(Measure_Select[Select A Measure],Period[Period]="ThisMonth")/Calculate(Measure_Select[Select A Measure],Period[Period]="MoM LastYearToDate")-1
For some reason Calculate accepts the calculated measure now...
Hi toulou,
>>Obviously, I want to use this formular to calculate the change in metric between two periods.
The challenge is that the measure changes based on the user input and there needs to be a variable. The measure table has 20 different measure names.
You can try to add a measure to merge these measures, then use switch or if function to result the specify value.
Result=
var conditionResult=//check the condition to choose a result measure.
return
SWITCH(conditionResult,1,[Measure1],2,"[Measure2]",3,[Measure3],...)
>>As far as I know, I cannot use CALCULATE or SUM because those don't support Created Measures.
No, you can use functions on measure, for example:
SUMX(Table,[Measure])
Calculate(MAXX(Filter(Table,condition),[Measure]),Filter(table,condition))
Regards,
Xiaoxin Sheng
I am not quite sure why it is working now but somehow it does:
Calc MoM YoY = Calculate(Measure_Select[Select A Measure],Period[Period]="ThisMonth")/Calculate(Measure_Select[Select A Measure],Period[Period]="MoM LastYearToDate")-1
For some reason Calculate accepts the calculated measure now...