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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Table/Matrix visual to collapse and expand visuals

I have a table visual or matrix visual as should below:

EalTim_0-1647604733333.png

However, I want to create a visual like below

EalTim_1-1647604788655.png

Where Name and Date can collapse and expand to see the subtotal of Type and Linecode.

How can I achieve this in power BI. I have tried using matrix but not getting it.

Please help

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Suppose you have the following data.

 

vkkfmsft_0-1647926568623.png

 

1. Then you can first unpivot the [Type] and [LineCode] columns. 

 

vkkfmsft_1-1647926595639.png

 

2. Create custom column.

 

Amount = if [Attribute] = "Type" then [TypeAmount] else [LineCodeAmount]

vkkfmsft_2-1647926718012.png

 

3. Create a matrix visual and add the following fields.

 

vkkfmsft_7-1647927114662.png

 

4. Turn off the "Stepped layout" option.

 

vkkfmsft_3-1647926906440.png

 

5. Turn off the row subtotals for the Attribute column and the Value column. And set the position of the totals to the top.

 

vkkfmsft_4-1647926940020.png        vkkfmsft_5-1647926962042.png       vkkfmsft_6-1647926991693.png

 

Then you can click on the expand/collapse symbol in front of the [Date] column.

 

vkkfmsft_8-1647927470250.png vkkfmsft_9-1647927514992.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Suppose you have the following data.

 

vkkfmsft_0-1647926568623.png

 

1. Then you can first unpivot the [Type] and [LineCode] columns. 

 

vkkfmsft_1-1647926595639.png

 

2. Create custom column.

 

Amount = if [Attribute] = "Type" then [TypeAmount] else [LineCodeAmount]

vkkfmsft_2-1647926718012.png

 

3. Create a matrix visual and add the following fields.

 

vkkfmsft_7-1647927114662.png

 

4. Turn off the "Stepped layout" option.

 

vkkfmsft_3-1647926906440.png

 

5. Turn off the row subtotals for the Attribute column and the Value column. And set the position of the totals to the top.

 

vkkfmsft_4-1647926940020.png        vkkfmsft_5-1647926962042.png       vkkfmsft_6-1647926991693.png

 

Then you can click on the expand/collapse symbol in front of the [Date] column.

 

vkkfmsft_8-1647927470250.png vkkfmsft_9-1647927514992.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

lbendlin
Super User
Super User

Are you aware of the "Show values on rows" feature for matrix visuals?  That will get you halfway there.  Your expected format is not something that can be achieved with the standard visuals.  You may have to craft your own, or modify your expectations.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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