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
riyadhiut
Regular Visitor

How to sum certain columns in power bi matrix visual

Hello Experts,
I have 20+ columns and 15+rows  in my power bi matrix visual.Please check  my visual below.My goal is to calculate sum from Month0 to Month 22 and display under "Total" column.If i enable "Column Subtotal" option only value of first column is shown under "Total" column.Kindly assist me on this.

shape.PNG

Regards,
Riyadh 

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @riyadhiut ,

 

This is a common problem. Many users in the forum have asked similar questions, which are generally caused by the aggregation of formulas. You can search and refer to them.

Rows and Column Totals are wrong in a Power BI Matrix 

Wrong column totals (table)  

...

In addition, you can also provide your DAX formula for us to analyze the error.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, 

I am confused. I have excel table which when converted to powerbi mtarix is showing unique values for each ctagory, which is correct, the the total is showing is incorrect. It is only counting unique values however if you see, Jeans order apperas twice so it should calculate total based on unique category. I know power BI doesnt let that happen automcatlly, can you please tell a work around?

 

Thanks a lot

 

newpowerbiuser8_0-1678397357613.png

 

DAx used : 

# Total Regs = CALCULATE(DISTINCTCOUNT('Table'[COLUMN]),FILTER('tABLE','tABLE'[COLUMN]<>"No data"))
Greg_Deckler
Super User
Super User

@riyadhiut - It's difficult to say for sure with the information provided. It could be all kinds of things. Not sure of what the source data looks like, etc. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.

 

But, a couple of guesses. Perhaps it is a measure totals issue? Quick Measure, Measure Totals, The Final Word should get you what you need: https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Maybe multi-column aggregations? https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

 

Maybe you need to unpivot your month columns in your source?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi, 

I am confused. I have excel table which when converted to powerbi mtarix is showing unique values for each ctagory, which is correct, the the total is showing is incorrect. It is only counting unique values however if you see, Jeans order apperas twice so it should calculate total based on unique category. I know power BI doesnt let that happen automcatlly, can you please tell a work around?

 

Thanks a lot

 

newpowerbiuser8_0-1678397357613.png

 

DAx used : 

# Total Regs = CALCULATE(DISTINCTCOUNT('Table'[COLUMN]),FILTER('TABLE','TABLE'[COLUMN]<>"No data"))

@riyadhiut one way could be to unpivot your data:

 

- transform data
- select Month Year column

- right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement
- close and apply

To visualize,
- matrix visual:
- add product and region on rows,
- add attribute on columns
- add value on values section

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



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.

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.