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
mysasai
Frequent Visitor

Matrix Visual Should show one row rather than summing next levels

Hi all,

 

I have a situation and I'm assuming it is not possible with straight forward functionalities of PBI. 

Please help me in solving this. 

I have a data source, something like below. 

 

GroupLEVEL1LEVEL2LEVEL3LEVEL4Value
XYZGlobal   8
XYZGlobalAPAC  8
XYZGlobalAPACENT 3
XYZGlobalAPACENTIHE0
XYZGlobalAPACENTM&E13
XYZGlobalAPACENTM&E20
XYZGlobalAPACENTM&E36
XYZGlobalAPACIMS 14
XYZGlobalAPACIMSIMS114
XYZGlobalAPACIMSIMS220
XYZGlobalAPACIMSIMS30
XYZGlobalAPACIMSIMS46
XYZGlobalAPACMED 0
XYZGlobalAPACMEDADV0
XYZGlobalAPACMEDBCS0
XYZGlobalAPACMEDCAS0
XYZGlobalAPACMEDPUB0
XYZGlobalNA  0
XYZGlobalNADTS 0
XYZGlobalNADTSITS0
XYZGlobalNAWTS 0
XYZGlobalNAWTSWTS20
ABCGlobal   4
ABCGlobalAPAC  4
ABCGlobalAPACENT 2
ABCGlobalAPACENTIHE0
ABCGlobalAPACENTM&E12
ABCGlobalAPACENTM&E20
ABCGlobalAPACENTM&E33
ABCGlobalAPACIMS 7
ABCGlobalAPACIMSIMS17
ABCGlobalAPACIMSIMS210
ABCGlobalAPACIMSIMS30
ABCGlobalAPACIMSIMS43
ABCGlobalAPACMED 0
ABCGlobalAPACMEDADV0
ABCGlobalAPACMEDBCS0
ABCGlobalAPACMEDCAS0
ABCGlobalAPACMEDPUB0
ABCGlobalNA  0
ABCGlobalNADTS 0
ABCGlobalNADTSITS0
ABCGlobalNAWTS 0
ABCGlobalNAWTSWTS20

 

I have dragged them into Matrix Visual like this.

 

mysasai_3-1732539004830.png

 

Currently it shows like the screenshot below. 

 

mysasai_0-1732538840486.png

I don't want to show the blank rows coming up in between and also don't want to show totals summed. 

 

I would want to see like below.

mysasai_4-1732539176650.png

 

Thanks in advance for helping. 

 

@amitchandak @Greg_Deckler @Icey 

2 ACCEPTED SOLUTIONS
Selva-Salimi
Solution Specialist
Solution Specialist

Hi @mysasai 

 

you can write a measure as follows:

 

Measure 2 = if (SELECTEDVALUE(My_Table[LEVEL4]) <> blank () , max(My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL3]) <> BLANK() , maxx(filter(My_Table,My_Table[LEVEL4]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL2]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL3]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL1]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL2]=blank()) , My_Table[Value]) ,blank()))))
 
and add it to values of your matrix.
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

View solution in original post

@mysasai 

 

then it would be better to update your measure as follows: 

 

Measure= if (ISINSCOPE(My_Table[LEVEL4]) , max(My_Table[Value]), if (ISINSCOPE(My_Table[LEVEL3]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3]=SELECTEDVALUE(My_Table[LEVEL3]) && My_Table[LEVEL4] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL2]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL1]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[Group]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) &&  My_Table[LEVEL1] = blank()),My_Table[Value]))))))
 
and easily can filter blank in the filter pane of matrix visual as follows"
SelvaSalimi_1-1732544123628.png

 

 
do the same for each level. if any Q feel free to ask.
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Selva-Salimi
Solution Specialist
Solution Specialist

Hi @mysasai 

 

you can write a measure as follows:

 

Measure 2 = if (SELECTEDVALUE(My_Table[LEVEL4]) <> blank () , max(My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL3]) <> BLANK() , maxx(filter(My_Table,My_Table[LEVEL4]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL2]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL3]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL1]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL2]=blank()) , My_Table[Value]) ,blank()))))
 
and add it to values of your matrix.
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

Thank you @Selva-Salimi, this worked and values are not suming up.

 

Any idea how would I hide blank rows highlighted in Red lines in screenshot. 

mysasai_0-1732541714657.png

 

@mysasai 

 

then it would be better to update your measure as follows: 

 

Measure= if (ISINSCOPE(My_Table[LEVEL4]) , max(My_Table[Value]), if (ISINSCOPE(My_Table[LEVEL3]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3]=SELECTEDVALUE(My_Table[LEVEL3]) && My_Table[LEVEL4] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL2]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL1]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[Group]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) &&  My_Table[LEVEL1] = blank()),My_Table[Value]))))))
 
and easily can filter blank in the filter pane of matrix visual as follows"
SelvaSalimi_1-1732544123628.png

 

 
do the same for each level. if any Q feel free to ask.
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

Hi @Selva-Salimi ,

I implemented the solution on a large dataset, adding a few other filter conditions such as ID and Date. However, after importing a few months of data, I encountered a resource error. It appears that the measure is comparing each row with the entire imported dataset, leading to performance issues.

I also tried using Direct Query. Although I only need to process 50,000 rows, the operation is comparing against millions of records in the database, resulting in the error: "Error fetching data for this visual in Power BI: 1,000,000 row limit error."

Is there a way to optimize the measure to first filter by a specific ID and then perform the remaining DAX operations on the filtered dataset?

 

Thank you for your assistance.

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.