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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Condition that checks if a matrix is collapsed, in order to display column data dynamically?

Hi everyone, I am fairly new to PowerBI but I have been enjoying my learning experience so far. I have been stuck on a problem though and was hoping someone might have any ideas.

 

I have an Excel with 4 columns (this is all test data):

  1. Category
  2. Sub-Category
  3. Description
  4. Sub-Category Description

I have the data displayed in a matrix visual that has the ability to collapse the Categories into their respective Sub-Categories. I am trying to figure out how to have just one "Description" column that:

  1. When uncollapsed (Category level), shows the "Description"
  2. When collapsed (Sub-Category level), shows the "Sub-Category Description".

 

IMG_0228.PNGIMG_0227.PNG

 

I was hoping that there would be an "isCollapsed" type condition I could use but I could not find a solution to this. 

 

Thanks so much in advance to any help.

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

Hi @Anonymous ,

 

Please create a measure like below and put it into "Values" of Matrix.

Measure =
IF (
    HASONEVALUE ( 'Table'[Sub-Category] ),
    MAX ( 'Table'[Sub-Description] ),
    IF ( HASONEVALUE ( 'Table'[Category] ), MAX ( 'Table'[Description] ), "NULL" )
)

1.gif

 

 

Best Regards,
Xue Ding
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-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a measure like below and put it into "Values" of Matrix.

Measure =
IF (
    HASONEVALUE ( 'Table'[Sub-Category] ),
    MAX ( 'Table'[Sub-Description] ),
    IF ( HASONEVALUE ( 'Table'[Category] ), MAX ( 'Table'[Description] ), "NULL" )
)

1.gif

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks so much! This is exactly what I was trying to figure out.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors