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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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/

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.