Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

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
parry2k
Super User
Super User

@Anonymous 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

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?

 

Hi @Anonymous ,

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.