Forum Discussion

pyramid1's avatar
pyramid1
Frequent Visitor
3 years ago
Solved

Matrix - Total between two columns with two row header.

Hello expert, I need some help with Matrix.

 

Here is my sample data:

I am expecting below output:

While playing with matrix , I couldn't get to expected output. So anyhelp would be appreciated.

 

Thanks. 

13 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

    One of many ways to achieve this is to unpivot the fact table and create a datamodel like below.

     

    • pyramid1's avatar
      pyramid1
      Frequent Visitor

      Thanks for response. It seems our powerBI Desktop versions are different hence My power BI Refuse to open pbix that you attached. Which version of PowerBI Desktop you are using.

    • pyramid1's avatar
      pyramid1
      Frequent Visitor

      Sorry, No. Don't have calendar in my data model. But I can use say 31/12/2022 and 31/12/2021 instead of 2021 and 2022. 

  • pyramid1's avatar
    pyramid1
    Frequent Visitor

    Jihwan_Kim  what would be the best way to find difference between two measure (is Diff Measure from Salary and Diff Measure from Tax). 

     

     

    • Jihwan_Kim's avatar
      Jihwan_Kim
      Super User

      Hi,

      I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

       

       

      Salary diff - Tax diff measure: = 
      CALCULATE ( [Diff measure:], Category[Category] = "Salary" )
          - CALCULATE ( [Diff measure:], Category[Category] = "Tax" )
      

       

      • pyramid1's avatar
        pyramid1
        Frequent Visitor

        Awesome Thanks. IS there a way to add this "Salary Diff - Tax diff Measure" as a separate column (With new category "Difference") in report after "Tax Diff Measure"?