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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.