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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
Super User
Super User

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
Super User
Super User

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors