cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
likhithar
Helper III
Helper III

No Blank rows when there is no Child Hierarchy in Matrix

Hello All,

         I have Multiple Hierarchies.For few we have Dimension at every level in Hierarchy.For few Some Low Hierarchy is Blank.

If the Low Hierarchy is Blank ,I dont want to see the Blank row.

I implemented the solution using ISINSCOPE DAX for 2 Hierarchies,If there were more than How to do that??

Measure =
IF(ISINSCOPE('Table'[Hier1]),
  IF(ISINSCOPE('Table'[Hier2]),
    IF(MAX('Table'[Hier2])=BLANK(),BLANK(),SUM([value])) , 
    SUM([value])),
   SUM([value]))

likhithar_0-1683014886304.png

 

How to achieve this scenario?

 

1 ACCEPTED SOLUTION

@Mahesh0016  
Thanks for the reply.
I got the solution with the following DAX

Sales  =
SWITCH(TRUE(),
ISINSCOPE(Sheet1[Hie 4])&&SELECTEDVALUE(Sheet1[Hie 4])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 3])&&SELECTEDVALUE(Sheet1[Hie 3])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 2])&&SELECTEDVALUE(Sheet1[Hie 2])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 1])&&SELECTEDVALUE(Sheet1[Hie 1])=BLANK(),BLANK(),SUM(Sheet1[Sales]))

View solution in original post

5 REPLIES 5
Mahesh0016
Solution Sage
Solution Sage

@likhithar 
Measure =
IF(ISINSCOPE('Table'[Hier1]),
IF(ISINSCOPE('Table'[Hier2]),
IF(ISBLANK('Table'[Hier2]),BLANK(),SUM([value])) ,
SUM([value])),
SUM([value]))

@Mahesh0016  
Thanks for the reply.
I got the solution with the following DAX

Sales  =
SWITCH(TRUE(),
ISINSCOPE(Sheet1[Hie 4])&&SELECTEDVALUE(Sheet1[Hie 4])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 3])&&SELECTEDVALUE(Sheet1[Hie 3])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 2])&&SELECTEDVALUE(Sheet1[Hie 2])=BLANK(),BLANK(),
ISINSCOPE(Sheet1[Hie 1])&&SELECTEDVALUE(Sheet1[Hie 1])=BLANK(),BLANK(),SUM(Sheet1[Sales]))

@Mahesh0016 The Mreasure which I mentioned my Post works fine if have 2 Hierarchies . I have 4 Hierarchies which I attached in the Image,for 4 Hierarchies I need the Solution

@likhithar please Share demo data.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors