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.
Hi all,
I'm facing to one difficulty to find, how can I display a correct percentage evolution by Year based on my YEAR selection (SLICER).
If I selectect consecutive year, my measure works well.
If I select non-consecutive years, the result is no longer correct with what I display 😞
I know the problem is my measure but I don't find how to adapt it.
See below :
Ok when Year selected are consecutive
Not ok in this case, Year not consecutive :
My measure :
M_PY_BOX % =
VAR PY = CALCULATE([M_BOX];DATEADD(T_CALENDAR[DATES];-1;YEAR))
RETURN
IF(ISEMPTY(PREVIOUSYEAR(T_CALENDAR[DATES]));"-";DIVIDE(([M_BOX]-PY);PY;0))
Thx in advance for your help and clarifcation.
R/
Fabrizio
Small Up,
Any Idea
Thx in advance for your help
Hi @Falongi_82 ,
This is happening because the slicer is removing the required previous year from the dataset that measure is using to calculate on . So you can us ALL() or REMOVEFILTER() function with your Date fields in your calculation .
You can refer to these links :-
https://learn.microsoft.com/en-us/dax/all-function-dax
https://learn.microsoft.com/en-us/dax/removefilters-function-dax
Hope this was helpful.
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Thx for your reply but not very clear for me 😞
I want just to adapt my following measure to display when I choose for exemple 2019/2021/2023 the good evolution based on my selection and not based on My previous Year (Year-1)
M_PY_BOX % =
VAR PY = CALCULATE([M_BOX];DATEADD(T_CALENDAR[DATES];-1;YEAR))
RETURN
IF(ISEMPTY(PREVIOUSYEAR(T_CALENDAR[DATES]));"-";DIVIDE(([M_BOX]-PY);PY;0))
Thx
Fabrizio
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 | |
102 | |
88 | |
63 |