Forum Discussion
Dynamic YoY percentage %
Hello all,
I've searched mulitple posts on this forum to try to solve this problem and I have had no luck so far.
I want to be able to calculate a percentage change of different fiscal years based on the slicer selection. However, I keep getting this (Blank) error when I select different years. When the same year is selected, the value is 100%.
I edited the interactions on the slicers so that I can select multiple years referencing the same calendar (which is called 'xFY Calendar').
any help/suggestions would be appreciated.
Thank you!
Hey Anonymous, make the following changes for the 2nd year:
RiderSelected2ndYear = VAR SelectedYearNumber = VALUE(RIGHT(SELECTEDVALUE('xFY Calender'[FY]), 2)) VAR PreviousYearNumber = SelectedYearNumber - 1 VAR PreviousFY = "FY" & FORMAT(PreviousYearNumber, "00") RETURN CALCULATE( [TotalRiders], FILTER( ALL('xFY Calender'[FY]), 'xFY Calender'[FY] = PreviousFY ) )if you would like to display a dash (-) instead of 'Blank' in the card, use the code below:
YoY % = IF( ISBLANK([RiderSelectedYear]) || ISBLANK([RiderSelected2ndYear]), "-", DIVIDE([RiderSelectedYear], [RiderSelected2ndYear], 0) )Please let me know what happend and if there are any issues.
12 Replies
- ahadkarimi
Solution Specialist
Hey Anonymous, try this code, and if you encounter any issues, let me know.
YoY % = IF( ISBLANK([RiderSelectedYear]) || ISBLANK([RiderSelected2ndYear]), BLANK(), DIVIDE([RiderSelectedYear], [RiderSelected2ndYear], 0) )- AnonymousNot applicable
Hello ahadkarimi,
I'm still getting the same error. Let me know if you need me to share my dashboard.Thank you,
- ahadkarimi
Solution Specialist
you can share it in microsoft onedrive or google drive and put it here or send it by mail to [email protected]
- ahadkarimi
Solution Specialist
Anonymous yes, please share your dashboard, and I'll help you troubleshoot the error.
- AnonymousNot applicable
https://app.powerbi.com/groups/me/reports/b011633c-404f-4297-9b2f-a5eee933e07d/ReportSectioncb9ff538a6edec19730c?experience=power-bi
let me know if you can't access it.- ahadkarimi
Solution Specialist
Yes, I have no access.