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
apiccolotto
Regular Visitor

How to hide rows in a matrix without affecting the measure calculation on aggregated data

Hello,

 

I have a matrix in which I show two measures (Measure1 and Measure2). I want that the rows with measure1 empty are not shown. 

 

apiccolotto_0-1595918732212.png

If I add in visual filter a filter like "Measure1 is not null",  the empty rows are hidden, but the aggregated value (Measure2 for the row of A that is 2170 in the example) changes since the row with measure1 blank are not considered. 

 

I need to hide these rows without affecting the aggregated calculation. Is that possible?

 

For info:

 

Measure1 = countrows(Table1)

Measure2 = countrows(Table2)

 

Table1 and Table2 are linked by the following reletionship.

The filed on the rows of the matrix are from Table3 and table4

 

apiccolotto_2-1595919309774.png

 

Thanks in advance.

 

 

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi @apiccolotto   ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @apiccolotto ,

 

You may delete the relationship between Table1 and Table4, change the Cross filter direction of other relationships from Single to Both, which will take these tables treated as a single table. Then  create a new measure like DAX below. Finally , you may put a filter like "Measure1 is not null" into Visual level filter of Table visual,

 

Measure2_New

var _table = SUMMARIZE('Table3', 'Table3'[Product Descr (Ord Ln)] ,"_Value", [Measure2] )

return
IF(HASONEVALUE('Table3'[Product Descr (Ord Ln)] ), [ Measure2], SUMX(_table,[_Value]))

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@apiccolotto , create a measure using is filtered or is in scope . and make measure 2 as blank when measure 1 is blank. But use a different measure for the total.

refer, these can help

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

https://www.sqlbi.com/articles/clever-hierarchy-handling-in-dax/

 

example for GT

sumx(values(Table[product]),[measure2])

for rows

sumx(values(Table[product]),if(isbalnk([measure1]),blank(),[measure2]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak,

 

thanks for the reply.

 

I create Measure3 following your suggest:

 

Measure3 = IF(ISINSCOPE('Table3'[Product Descr (Ord Ln)]),
sumx(values('Table3'[Product Type (Ord Ln)]),if(ISBLANK([Measure1]),blank(),[Measure2])),
sumx(values('Table3'[Product Type (Ord Ln)]),[Measure2]))
 
It seems it doesn't work since it returns the same value of measure2.
 
Thanks in advance.
 
A.

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