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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. 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/

 

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors