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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MStark
Helper III
Helper III

Power BI Matrix - Total doesnt equal Rows

Hi,

 

I have a list from my bank that I want to put into a Matrix in Power BI. Issue is that not all transactions equal up tot the Bank Total for that day (there are some hidden transactions that dont get included on the file. I want the matrix to still calcualate by giving the total and transactions in rows

 

Sample Data:

DateDescriptionAmount
13-NovBank Total150
13-NovRent-620
13-NovGrocery-22
13-NovPayroll956
12-NovBank Total1000
12-NovBook Fee-100

 

 

Im looking for a Matrix like this

 

MStark_0-1699979126169.png

 

Even if transactions dont equal the total, it should show correctly. Can this be done and if yes, how

 

Thanks in advance for your help and time!

6 REPLIES 6
TheoC
Super User
Super User

@MStark I don't believe what you are wanting to achieve can be done in a Matrix in the identical format you are wanting.  The reason is that you're trying to show the row "subtotal" based on a specific item in your Description field. You can segregate the Bank Total through a measure and then add the other items back (i.e. the first Matrix on the left) or you can slightly modify the way in which you structure your Matrix table to achieve the output on the right.  

 

TheoC_0-1699990570107.png

If you like the Matrix on the right, you need to use Power Query.  Do the following:

  • Add a conditional column:
    1. Column Name = Description
    2. Operator = Equals
    3. Value = Bank Total
    4. Output = 1
    5. Else = null

TheoC_1-1699990867892.png

  • Add Index column in Power Query

TheoC_2-1699990935866.png

  • Add a conditional column:
    1. Column Name = Custom
    2. Operator = Equals
    3. Value = 1
    4. Output = 1
    5. Else = Index

TheoC_3-1699990988479.png

  • From here, you can "Close & Apply" and return to Power BI Desktop's canvas view.
  • Go to the Matrix visual and drag the fields in to match the below. 

TheoC_4-1699991078397.png

  • When you're done, ensure you go to the:
    • Visual options
    • Click on Row Headers
    • Click on Options
    • Turn off "Stepped Layout".

 

Hope this helps mate.

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC This is a great work around! I might have to resort to this but I was thinking more to have the option to open or close and freeze the row with totals. If you think of any other ideas, let me know

 

Thanks so much for your time!!

@MStark I know what you mean, mate.  Although Microsoft is consistently releasing new updates for Power BI and its visuals, the good ol' Matrix has been somewhat of a tender one haha. 

 

Personally, I don't think there is a way to achieve what you're after through a single column for values given that the subtotal would be ignoring both column and row level context (i.e. in that the subtotal would not be the sum of the rows and the rows would not equate to the sum of the categorys' column values).  

In saying that, I have been wrong many times before and I undoubtedly will be wrong many times more. I hope that I'm wrong in this instance, mate.  

 

All the best!

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC Your probably right since the more I think about it the more I realize why it Microsoft wouldnt allow it. A Matrix is a mathamatical structure and it wouldnt make sense for it not to add up. Will have to think of another way to make this work.

Thanks again for your time and responses!!

@MStark spot on, mate.  It would be "illogical" in a world of extreme "logic" haha! 

 

Either way, keep us posted on whether you find a solution. Will be interesting to see what you come up with!

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

arvindsingh802
Super User
Super User

You can refer https://community.fabric.microsoft.com/t5/Desktop/Total-of-Matrix-column-doesn-t-equal-sum-of-all-it...


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.