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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
atul9063
Helper III
Helper III

Non Additive Hierarchy Slicer

Hi,

 

I want to create Non Additive Heirarchy Slicer.When user select Americas in Hierarchy slicer, then All value which is 200 should display in graph instead of Total 470.

image.png

 

 

Dataset 

 

DateMetricRegionCountryValue
2/1/2019 0:00EUAmericasAll200
2/1/2019 0:00EUAmericasCanada100
2/1/2019 0:00EUAmericasMexico50
2/1/2019 0:00EUAmericasUS120
2/1/2019 0:00EUAsiaAll500
2/1/2019 0:00EUAsiaChina400
2/1/2019 0:00EUAsiaIndia200
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @atul9063 

 

You may create a measure like below:

Measure = 
IF (
    HASONEVALUE ( Table3[Country] ),
    SUM ( Table3[Value] ),
    CALCULATE ( SUM ( Table3[Value] ), Table3[Country] = "ALL" )
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
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

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @atul9063 

 

You may create a measure like below:

Measure = 
IF (
    HASONEVALUE ( Table3[Country] ),
    SUM ( Table3[Value] ),
    CALCULATE ( SUM ( Table3[Value] ), Table3[Country] = "ALL" )
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-cherch-msft 

I have added two heirarchy slicer Client and UserType.As per above solution, its working fine for ClientType but not for UserType.For UserType is adding up values.Could you please check below DAX and let me know what i m doing wrong?

 

ClientMeasure =
IF (
    HASONEVALUE ( r1Metrics[ClientType] ) ||  HASONEVALUE ( r1Metrics[UserType] ) ,
    SUM ( r1Metrics[Measure] ),
    CALCULATE ( SUM ( r1Metrics[Measure] ), r1Metrics[ClientType] = "ALL", r1Metrics[UserType]="All" )
)
image.png

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.