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.
Thanks for this Lionel. We are using this to show revenue change over import dates in our production schedule, and I am wondering how I can edit this formula to allow additional filtering by both import date, and planned end date.
The difference formula works when filtering by one column "import date":
But when I try to filter by the month end date, it gives me this:
Is there another clause I need to add to allow filtering by both import date and planned end date?