YoY change (%) based on selection of year

Hi Folks,

I am having a challenge with DAX calculation. I’d like to show a chart for YoY sales % change based on the year I select. The year is fiscal year, so it is a text. I have a measure to calculate Prior Year sales and Current Year sales. I am using Selectedvalue to get filter value so I am expecting current year sales and previous year sales will be changed based on the year I select from filter dynamically, however, it looks like there is a problem with my measure “Prior Year Sales”, it does not change based on the fiscal year I select. This topic could have been discussed and solution might have been post on the forum. If you know the post, could you please point me to the right direction? If not, could you please check what is wrong with my solution?

Attached you will find my PowerBI file.

Thanks!

Mike

test.pbix (31.3 KB)

1 Like

Hello Mike,

Hope you are doing well.
for Time calculation there must be date col in your model.
It seems missing you have year with text format.
Request to data col.
Then you will able to calculate YOY %

Regards,
Pankaj

Hi Pankaj,

That is the challenge that we only have Fiscal year in the column, which I created a Fiscal Year index column on the table. Is there a way to create a measure to take the the value from the filter selection to do YoY calculation without using YoY time function?

@BrianJ , do you know if there was a similar topic post on the forum before? thanks for your help!

Thanks!

Mike

Thanks, I used Selectedvalue plus Switch (Ture()) solved the problem.

Okay, Thanks