Forum Discussion

pang22's avatar
pang22
Icon for Helper III rankHelper III
2 years ago
Solved

Correct the total in Matrix

Hello

 

I have a table with budget and amount
$234 budget fot ITBD
$1749 budget for ITHQ

 



When I make matrix in PowerBI, the budget column will auto sum, so I choose minimum for budget by each code. But the total row will only show the minimum (234)

How to correct the total to a correct format? (i.e. 234+1749 = 1983)

 

 

 

 

  • Hi pang22 

    Please try the below measure for your Budget value.

    Measure =
    SUMX(DISTINCT('Table'[Code]),CALCULATE(MIN('Table'[Budget])))
     

     

     

    I am getting the expected output you wanted.


    I hope I answered your question!

     

5 Replies

  • Wilson_'s avatar
    Wilson_
    Icon for Memorable Member rankMemorable Member

    Hi pang22,

     

    You chose minimum, so your matrix is showing you the minimum. Why does sum not work for you? What output are you looking for?

    • pang22's avatar
      pang22
      Icon for Helper III rankHelper III

      Hi Wilson_ 

       

      If choose sum, it will sum the buget

       

      Becasue I only have one budget for each Code. And spend in each category.
      $234 budget fot ITBD, spend $134
      $1749 budget for ITHQ, spend $42 & $53



      I am looking for the table in below format with correct total (i.e. 234+1749 = 1983)

       

       

  • Uzi2019's avatar
    Uzi2019
    Icon for Community Champion rankCommunity Champion

    Hi pang22 
    Can you can share the Sample data in excel or pbix file so will look into this?

     

    • pang22's avatar
      pang22
      Icon for Helper III rankHelper III

       

      Hi Uzi2019 


      This is the data in excel. Thank you.

      CodeCategoryBudgetCommitted amount
      ITBDUpgrade234134
      ITHQRegulation174942
      ITHQMaintenance174953
      • Uzi2019's avatar
        Uzi2019
        Icon for Community Champion rankCommunity Champion

        Hi pang22 

        Please try the below measure for your Budget value.

        Measure =
        SUMX(DISTINCT('Table'[Code]),CALCULATE(MIN('Table'[Budget])))
         

         

         

        I am getting the expected output you wanted.


        I hope I answered your question!