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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
alee5210
Helper II
Helper II

Matrix Rollup When Using Text

Hi, I am having some issues with the matrix visual when I want text to roll up. Right now I have some data that looks like the below. It is simple with the main city, the store, how the store is performing, a comment on performance and a comment number. A comment number always coresponds to the same comment, it is a 1-1 relationship. In the case where the child is null, it means that the City only has one store.

Parent Child Rating Comment Comment Number
City A   Red Warning: Low Confidence 3
City B Store 1 Red Trend: Decreasing 2
City B Store 2 Green Warning: Small Sample Size 1
City B Store 3 Amber    
City C   Red Trend: Decreasing 2

 

My issue is that in the matrix visual, it is not behaving like I want.

When everything is expanded, I can see the following. Where it is City B - Amber, I would like to see one of the comments there based on the comment number. So if I want to see max(comment number) then it will be 'Trend: Decreasing' and if it is min(comment number) then it will be 'Warning: Small Sample Size'.

alee5210_0-1713142259092.png

Similarly, when it is rolled up, it looks like the following but I want to see one of my comments for Store B, based on the comment number just like above.

alee5210_2-1713141393427.png

Is this possible?

 

Edit: I have tried splitting the Parent/Child/Rating/Comment Number colums into their own table and the Comment/Comment Number into its own table and creating a many to 1 relationship using the Comment Number columns, but this made less sense.

It was always like the below where it would only show one value for the Comment Number and Comment Text. 

alee5210_0-1713141770396.png

 

1 ACCEPTED SOLUTION
alee5210
Helper II
Helper II

I have found a solution using the measure below:

 

Test Measure =
if(
   count('Test Data'[Comment])=1, -- Count the number of comments and if it is equal to 1
   selectedvalue('Test Data'[Comment]), --Then use the comment that is 'provided'
   calculate(selectedvalue('Test Data'[Comment]), 'Test Data'[Comment Number] = max('Test Data'[Comment Number]))) -- If there is more than one comment then select the comment where the comment number is equal to max(comment number)
 
This seems to give me the result I am looking for in this case.
alee5210_0-1713150176580.png

 

It does not solve the first case though when you expand it, once expanded the top level is blank which is something I will live with.

View solution in original post

4 REPLIES 4
alee5210
Helper II
Helper II

I have found a solution using the measure below:

 

Test Measure =
if(
   count('Test Data'[Comment])=1, -- Count the number of comments and if it is equal to 1
   selectedvalue('Test Data'[Comment]), --Then use the comment that is 'provided'
   calculate(selectedvalue('Test Data'[Comment]), 'Test Data'[Comment Number] = max('Test Data'[Comment Number]))) -- If there is more than one comment then select the comment where the comment number is equal to max(comment number)
 
This seems to give me the result I am looking for in this case.
alee5210_0-1713150176580.png

 

It does not solve the first case though when you expand it, once expanded the top level is blank which is something I will live with.

That's where ISINSCOPE would have come into play.

lbendlin
Super User
Super User

Read about ISINSCOPE and then decide how you want to handle each of the scenarios.

I have had a look at ISINSCOPE but i'm not sure if it is applicable to this scenario. It looks like it can filter data but not roll up data when using the matrix visual. Can you give me a bit more direction as to how to apply it?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors