cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

Super User III
Super User III

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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

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

Top Solution Authors
Top Kudoed Authors