cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pundiv01 Regular Visitor
Regular Visitor

comparison when two consecutive years are selected

 

I have a power BI dashboard where I am getting data from Live Query so all the calculated measure coming from SSAS cubes. There are two measures which has the calculated data of current year and last year. so when I select the year and month from Power BI slicer it gives a comparison for both year;this is fine till this point. But when I select all the months for year 2019 (where it has actually values for Jan,Feb,March) so it should take the data for same months in year 2018 but this is showing all the data for last year in comparison of 3 month data in current year.

Is there any solution in power bi or shall I have to change in MDX measure which is below for last year

 

([Product Volume],ParallelPeriod([Time].[Year Code Dynamic].[Year Code Dynamic],1,[Time].[Year Code Dynamic].CURRENTMEMBER))

 

Please advise where I have to change Power BI or MDXdata_actually.JPGdata when whole year is selected.png

Please advise and ask me in case of any confusion.

3 REPLIES 3
Super User IV
Super User IV

Re: comparison when two consecutive years are selected

@pundiv01 there are many functions in DAX to achieve this but not available when you are using Live connection with SSAS, your option is to either import data (might not be possible) or write MDX.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





pundiv01 Regular Visitor
Regular Visitor

Re: comparison when two consecutive years are selected

Can Anyone suggest me on MDX?

I have created MDX to calculate data for last year. Which is

([Product Volume],ParallelPeriod([Time].[Year Code Dynamic].[Year Code Dynamic],1,[Time].[Year Code Dynamic].CURRENTMEMBER))

 

Do I need change in that?

 

Community Support Team
Community Support Team

Re: comparison when two consecutive years are selected

Hi @pundiv01 ,

In Power BI, it supports DAX currently.

If you want to get support of MDX, you should post your requirement in SSAS Forum to get the most professional help.

If you want to achieve your desired output in Power BI, you could import you data in Power BI and then create the dax formual as parry2k mentioned.

If you need help for dax, please share your data sample with table format so that I could have a test on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors