Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
hi @schwinnen
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 %] - lastWeekAmount
or
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALLSELECTED ( 'Stop' ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmount
If not your case, just share a simple sample pbix file and the expected output in different scenarios.
Regards,
Lin
hi @schwinnen
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 %] - lastWeekAmount
or
CHANGE =
VAR lastWeekAmount =
CALCULATE (
[COMPLETE %],
FILTER (
ALLSELECTED ( 'Stop' ),
Stop[TOTAL WEEK #]
= MIN ( Stop[TOTAL WEEK #] ) - 1
)
)
RETURN
[COMPLETE %] - lastWeekAmount
If not your case, just share a simple sample pbix file and the expected output in different scenarios.
Regards,
Lin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |