Forum Discussion
Difference instead of Total in PowerBI Matrix
- 6 years ago
Hi common763 ,
Please create such a measure.
Measure = VAR x = CALCULATE( SUM(Sheet4[Number]), FILTER( ALLSELECTED(Sheet4), Sheet4[DATE] < MAX(Sheet4[DATE]) && Sheet4[FACILITY] = MAX(Sheet4[FACILITY]) ) ) VAR y = CALCULATE( SUM(Sheet4[Number]), FILTER( ALL(Sheet4), Sheet4[DATE] = MAX(Sheet4[DATE]) && Sheet4[FACILITY] = MAX(Sheet4[FACILITY]) ) ) RETURN IF( HASONEFILTER(Sheet4[DATE]), SUM(Sheet4[Number]), x-y )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi common763 ,
Please create such a measure.
Measure =
VAR x =
CALCULATE(
SUM(Sheet4[Number]),
FILTER(
ALLSELECTED(Sheet4),
Sheet4[DATE] < MAX(Sheet4[DATE]) && Sheet4[FACILITY] = MAX(Sheet4[FACILITY])
)
)
VAR y =
CALCULATE(
SUM(Sheet4[Number]),
FILTER( ALL(Sheet4), Sheet4[DATE] = MAX(Sheet4[DATE]) && Sheet4[FACILITY] = MAX(Sheet4[FACILITY]) )
)
RETURN
IF(
HASONEFILTER(Sheet4[DATE]),
SUM(Sheet4[Number]),
x-y
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Lionel,
Thank you, this was really helpful, However for some fields the calculation is wrong. How this can be solved.
And is there any Measure to calacute the difference without the dependence of Rows.
Would be great if you could help me on this please, much appreciated, thank you.
Note: I have Week number in Column, and when I filter/slicer 2 weeks the difference should calculate only for that two columns and not for the entire columns.
Regards,
Sreepathi K