Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

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 MDX

Please advise and ask me in case of any confusion.

3 Replies

  • 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.

    • Anonymous's avatar
      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?

       

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        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