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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lukaninda
Frequent Visitor

Display selected hierarchy objects on a page

Hello, everyone!

I create dashboards based on financial information of a group of companies. There is a two level organizational hierarchy - let's say Level 1 and Level 2. Sample structure looks like this: 

Cluster 1 (Level 1) includes entities A, B, C (Level 2)

Cluster 2 (Level 1) includes entities X, Y, Z (Level 2)

 

There are slicers on my dashboards which allow users to navigate through this hierarchy and see information they need. My task is to show on the report page which entity is currently selected via slicer. I solved it by adding cards. It works perfectly when a separate entity is selected. However, when I want to see aggregated cluster-level data, entities are also displayed (it's obvious because all entities in a cluster are being selected). Is there any solution to not show any output when whole clusters are selected?

 

What I managed to do:

Slicer: entity B of cluster 1 is selected

Card 1: Cluster 1

Card 2: Entity B

 

Desired result:

Slicer: cluster 1 is selected

Card 1: Cluster 1

Card 2: empty

 

I would appreciate any help with alternative solutions, if this is unrealizable through cards.

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

Hi @lukaninda ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_2-1679622066338.png

Please try:

Level2 = SELECTEDVALUE('Table'[Level 2])

Final output:

vjianbolimsft_0-1679622030708.png

vjianbolimsft_1-1679622045981.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @lukaninda ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_2-1679622066338.png

Please try:

Level2 = SELECTEDVALUE('Table'[Level 2])

Final output:

vjianbolimsft_0-1679622030708.png

vjianbolimsft_1-1679622045981.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thank you, Jianbo! This works excatly as I needed. I actually didn't expect there was such an easy solution. I have worked out my own, which is customized for my specific needs. 

First, I created a measure that counts currently selected entities. The formula is simple:

entities_counter = COUNT('Table1'[Level 2])

Then the same with clusters:

clusters_counter = COUNT('Table1'[Level 1])

Second, I create a measure, which value depends on the counters:

entity_card = SWITCH(TRUE(),
'Table1'[entities_counter] > 1, "",
'Table1'[entities_counter] = 1, SELECTEDVALUE('Table1'[Level 2]),
BLANK())

What I wanted from this measure is to show nothing ("") when 2 or more entities of Level 2 are currently selected.

Measure for clusters is almost the same except for it shows the name of the holding when 2 or more clusters are selected:

cluster_card = SWITCH(TRUE(),
'Table1'[clusters_counter] > 1, "Holding_name",
'Table1'[clusters_counter] = 1, SELECTEDVALUE('Table1'[Level 1]),
BLANK())

I hope my solution will also be useful to someone.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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