Forum Discussion
Referring A Measure inside Another Measure
- 8 years ago
HI Ynew
Please try this MEASURE
TotalVolume = VAR mymonth = [LastMonth] RETURN COUNTAX ( FILTER ( 'Report1', 'Report1'[Month] = mymonth ), 'Report1'[Volume] )
Thank you very much.
As I compare, I see that yours is the same as mine. But still cannot understand why mine is not working! if it is related to Power BI version, or...!
- Zubair_Muhammad8 years agoCommunity Champion
- Zubair_Muhammad8 years agoCommunity Champion
Actually whats going on with your formula is that...... it is returning the Full Table.
Your MEASURE is calculated for each row of the Table and returns the Last Month for each filtered row.
Thats why you need to take the MEASURE out of the CALCULATE and put it in a VARIABLE before CALCULATION
TotalVolume = VAR mymonth = [LastMonth] RETURN COUNTAX ( FILTER ( 'Report1', 'Report1'[Month] = mymonth ), 'Report1'[Volume] )- Zubair_Muhammad8 years agoCommunity Champion
When you use
FILTER('Report1','Report1'[Month]=[LastMonth])
this returns the whole table instead of the Filtered Table with the LastMonth.
Why?
Because MEASURE is assessed for each ROW of the TABLEThats why you need to put the value of the MEASURE in a VARIABLE first
- Ynew8 years agoHelper I
It partially does, but I do not want to have the month (to not to include Dec) as a report level filter not as an slicer.