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
Anonymous
Not applicable

Dealign with Slicer Nodes

I have a scenario where I have hierarchical data that I want to use to filter visualisation.

Example Data set is a simple, two column, table of COUNTRY and TOWN.

I have dragged on a SLICER control and added COUNTRY and TOWN to it, and opted for SINGLE SELECTION.

(It is useful to include COUNTRY in the slicer since TOWN could be duplicated and the list might be very long).

I also have a simple CARD which I want to display the selected TOWN.

The problem is two-fold:

1.  I can't stop the user clicking on the COUNTRY node of the slicer (selecting a country) which actually automatically select ALL the TOWNs under that node (which is annoying since I've elected single selection).

2.  If I accept that they can select a COUNTRY then the data showing on the page is actually a summary of the countries TOWNs, which might be useful, but.... I can't get the CARD to to show the COUNTRY name instead of the (first) TOWN.

 

I've tried the 3rd-party Hierarchy Slicer, which addresses the first issue, but for some reason it renders horrible (like an out-of-focus image), and just spoils the dashboards.

 

So... has anyone found a nifty way to control node selection on a slicer ?

Or...

Can anyone suggest some nifty DAX to show the COUNTRY if it's selected, and TOWN if COUNTRY isn't selected ?

 

(sorry for the long winded explanation).

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hello @EnateJon ,

Check this measurement.

Measure = IF(DISTINCTCOUNT('Table'[town])=1,SELECTEDVALUE('Table'[town]),SELECTEDVALUE('Table'[country]))

The result would be displayed as shown below.

1.PNG2.PNG

Best regards

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hello @EnateJon ,

Check this measurement.

Measure = IF(DISTINCTCOUNT('Table'[town])=1,SELECTEDVALUE('Table'[town]),SELECTEDVALUE('Table'[country]))

The result would be displayed as shown below.

1.PNG2.PNG

Best regards

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Greg_Deckler
Super User
Super User

@Anonymous - Seems like you could use ISINSCOPE in a measure and put that in a card visualization, sort of like:

https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Most-Amazing-Mind-Blowing-Dynamic-Slicer-Title-Measure-Ever/m-p/429587#M154


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.