Forum Discussion
Filter - ALL, ALLSELECTED, ALLEXCEPT
I use the formula below to calculate change from previous week. This works well when no filters are applied (or only applied to the 3 categories I have in the formula - NAME, BRAND and active_status). Is there a way to make this work regardless of what filters are applied? I can inlude every possible filter category in the formula, but it seems like there should be an easier way. I've tried variations of ALL, ALLSELECTED and ALLEXCEPT, but nothing has worked so far.
hi Anonymous
You could try this formula
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALL ( Stop[TOTAL WEEK #] ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmountor
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALLSELECTED ( 'Stop' ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmountIf not your case, just share a simple sample pbix file and the expected output in different scenarios.
Regards,
Lin
1 Reply
- v-lili6-msftCommunity Support
hi Anonymous
You could try this formula
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALL ( Stop[TOTAL WEEK #] ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmountor
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALLSELECTED ( 'Stop' ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmountIf not your case, just share a simple sample pbix file and the expected output in different scenarios.
Regards,
Lin