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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Conditional display for total in matrix

I have a matrix with the following fields:

I add a total for level2
Capture.PNG
How can I hide level2 when it's blank and I need to keep the total for level1?
For example the following picture, For the line "Moto" I need to hide the line when  level 2 is null  I need to keep to display the total?
Expected results:
Dim5RapportDim6RapportAN
AutoTotal4
 Click & go2
 Refeerence2
MotoTotal2
SanteTotal2
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a measure as a logical condition for [AN].

Measure 2 =
VAR test1 =
    IF ( ISINSCOPE ( Dim_Produit[Dim6Rapport] ), TRUE () )
RETURN
    IF (
        ISINSCOPE ( Dim_Produit[Dim5Rapport] )
            && MAX ( Dim_Produit[Dim6Rapport] ) <> "null",
        TRUE (),
        NOT ( test1 )
    )

test_Conditional display for total in matrix.PNG

Sample .pbix

 

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

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a measure as a logical condition for [AN].

Measure 2 =
VAR test1 =
    IF ( ISINSCOPE ( Dim_Produit[Dim6Rapport] ), TRUE () )
RETURN
    IF (
        ISINSCOPE ( Dim_Produit[Dim5Rapport] )
            && MAX ( Dim_Produit[Dim6Rapport] ) <> "null",
        TRUE (),
        NOT ( test1 )
    )

test_Conditional display for total in matrix.PNG

Sample .pbix

 

Best Regards,
Liang
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

@Anonymous , refer if this can help

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

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
Greg_Deckler
Community Champion
Community Champion

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, MM3TR&R: https://community.powerbi.com/t5/Quick-Measures-Gallery/Matrix-Measure-Total-Triple-Threat-Rock-amp-...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.