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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
heman
Frequent Visitor

selection of visual using hierarchy slicer

I have 3 level hierarchy of location.1 Region has multiple districts & in a district it has multiple blocks.

Level 2:Region

Level1 :District

Level0:Blocks

 

As per requirement All regions should be displayed by defaut,If I select region in slicer the donut chart should display all the districts in that region.

If I select particular district(Means in a region,a district) all the blocks belong to that district need to be shown in the visual.

I have written one dax which is working only when region is selected in slicer or only district is selected in slicer.But if both are selected its not showing any values.Also its not working at all in hierarchy slicer.

Dax Measure:

sales_by-Level =
IF (
    HASONEFILTER ( country[Region] ),
    CALCULATE ( [Inqty_sum], 'Level'[custom] = "L1" ),
    IF (
        HASONEFILTER ( country[District] ),
        CALCULATE ( [Inqty_sum], 'Level'[custom] = "L0" ),
        CALCULATE ( [Inqty_sum], 'Level'[custom] = "L2" )
    )
)

Please correct me.

Visuals for understanding..

https://drive.google.com/drive/folders/1vqp-U28kvjk-tZGUIibGjRyYOA1OiQpJ?usp=sharing

 

Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @heman,

Perhps you can take look at the following blog about handle different levels of hierarchy fields.

Clever Hierarchy Handling in DAX 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @heman,

Perhps you can take look at the following blog about handle different levels of hierarchy fields.

Clever Hierarchy Handling in DAX 

Regards,

Xiaoxin Sheng

MFelix
Super User
Super User

Hi @heman 

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors