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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors