- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @erruiz, 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@erruiz yes, please share your dashboard, and I'll help you troubleshoot the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
https://app.powerbi.com/groups/me/reports/b011633c-404f-4297-9b2f-a5eee933e07d/ReportSectioncb9ff538...
let me know if you can't access it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I have no access.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @erruiz, try this code, and if you encounter any issues, let me know.
YoY % =
IF(
ISBLANK([RiderSelectedYear]) || ISBLANK([RiderSelected2ndYear]),
BLANK(),
DIVIDE([RiderSelectedYear], [RiderSelected2ndYear], 0)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @ahadkarimi,
I'm still getting the same error. Let me know if you need me to share my dashboard.
Thank you,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can share it in microsoft onedrive or google drive and put it here or send it by mail to ahad.karimi8@gmail.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
let me know if this works, I saved it onto a google drive.
https://drive.google.com/file/d/1il0EgIIT4H_8D7t6bzuim_vALyTxRpKH/view?usp=sharing
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @erruiz, could you please check the RiderSelectedYear and RiderSelected2ndYear measures to see if they are correct?
for testing, you can add a table from the Visualization pane, include these two measures in the table, and review the values according to the slicer selections (are those correct?).
I suspect that the issue might be with the RiderSelectedYear and RiderSelected2ndYear measures. Could you verify and let me know if any problems still persist?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I just checked and the measures don't show up on the table if both slicers are selected. Do you have an alternative solution to the RiderSelect measures? do you think I need to reference another data set since it appears that selecting two years from the same dataset cancels them out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @erruiz, 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, this solution above works. I was hoping that the YoY% measure would be able to work by selecting any fiscal year instead of only the year prior but I suppose Power BI is limited in that way.
Thank you so much for your effort and your steady communication with me!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@erruiz you're very welcome! I'm happy to help and always here whenever you need me.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

User | Count |
---|---|
19 | |
14 | |
10 | |
9 | |
9 |
User | Count |
---|---|
15 | |
14 | |
12 | |
11 | |
11 |