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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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