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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
nardtmo
Helper III
Helper III

matrix table - column become row and calculate sum

Hi all,

 

hope things are well. Need help on the issue below.  I have a lot of columns in this report and so i sure if i can use unpivot. 

appreciate all the help. Be safe everyone.  

 

Thanks in advance

 

pbi_issue_ matrix table.PNG

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

In the query editor, after you remove the column with "Column 1 to 59", just highlight the address through the section columns, then right click and choose unpivot other columns.  You can then have a simple measure of Sum(Table[Value}) (or whatever you rename it to). and then use the Attribute column as your rows in a matrix visual with the RF Review Summary as your columns (and the Sum() measure in the values area).

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

Do you need the info in columns 1 to 59 for something else? Do the columns Final 1 to Final 9 change names or ever change? If you just want to unpivot those columns, you could select only columns Final 1 to Final 9 using Unpivot Only Selected Columns as an option. 

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thanks. columns names for final 1 - 9 never change. but their values are changing based on the input from other table  (excel). col 1-59 is needed for tracking purposes  (feedback from all dept.).  ill try to duplicate query, remove all columns excepts the ones i need to unpivot.

 

Add an index first, then reference the query rather than duplicate and that way you can create a relationship between the two tables after they're unpivoted. 

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

amitchandak
Super User
Super User

@nardtmo , In the matrix you have option show on row.  That will put the measure on the first column. You can try that

 

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

 

Others are unpivot and transpose

https://radacad.com/pivot-and-unpivot-with-power-bi

https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

In the query editor, after you remove the column with "Column 1 to 59", just highlight the address through the section columns, then right click and choose unpivot other columns.  You can then have a simple measure of Sum(Table[Value}) (or whatever you rename it to). and then use the Attribute column as your rows in a matrix visual with the RF Review Summary as your columns (and the Sum() measure in the values area).

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors