Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello
I have built a report (matrix) which looks like this...
I can use the [+] buttons on each row to drill though the accounts hiarchy to show different levels of detail - Level 1 (summary) to Level 4 (detail). In the screenshot below the tree has been expanded to show level 2 detail.
I would like to make my Tooltip window dynamic so that it shows the next level of detail to what is displayed.
It is easy to fix it so it always displays level x data for the cell I am hovering over but not the next level down (screenshot below is fixed to show level 2).
I can ascertain what level the main report is expanded by checking if the following expression is true:
How can I use this to vary the contents of the Tooltip?
Thanks in advance for your help.
Regards
Andrew
P,S. Reports contain spurious test data not real data.
Hi @Andrew-HLP ,
It often makes more sense to use a mapping table rather than hardcoding the logic directly in DAX. This keeps your model cleaner, more scalable, and easier to maintain, especially if the hierarchy changes or grows.
Instead of using a SWITCH statement like this:
VAR CurrentLevel =
SWITCH(
TRUE(),
ISINSCOPE('GL Map Accounts'[Level 4]), 4,
ISINSCOPE('GL Map Accounts'[Level 3]), 3,
ISINSCOPE('GL Map Accounts'[Level 2]), 2,
ISINSCOPE('GL Map Accounts'[Level 1]), 1,
0
)
You could create a simple mapping table like this:
LevelName | LevelOrder | NextLevel |
Level 1 | 1 | 2 |
Level 2 | 2 | 3 |
Level 3 | 3 | 4 |
Level 4 | 4 | 5 |
Then, in your 'GL Map Accounts' table, include a LevelOrder column and set up a relationship or use a lookup to bring in the corresponding NextLevel.
Your measure would become:
ShowOnlyNextLevel =
VAR CurrentLevelOrder =
MAX('GL Map Accounts'[LevelOrder])
VAR NextLevelOrder =
CALCULATE(
MAX('Level Mapping'[NextLevel]),
FILTER(
'Level Mapping',
'Level Mapping'[LevelOrder] = CurrentLevelOrder
)
)
RETURN
MAX('GL Map Accounts'[LevelOrder]) = NextLevelOrder
This way, you’re decoupling logic from DAX and putting structure in your data model, which is always a good idea when dealing with complex or potentially changing hierarchies.
Best regards,
Hello, thanks for the reply. You are right, I am currently using SWITCH and ISINSCOPE() to return the current level / next level (current level + 1). Switching to a table might be neater, but it doesnt solve my problem.
My mapping table ('GL Map Accounts') table looks like this:
NB: I realise I could make this more efficient by holding the mapping for each pair of levels (e.g. Level 1 and Level 2, Level 2 and Level 3, Level 3 to Level 4) in seperate tables but users find a flat structure easier to work with.
I want rows in the Tooltip window to dynamically change to show the next level down when I hover over a cell. Its easy enough to fix the level or even dynamically change it using the parameter and slicer
Code for Parameter (doesn't allow conditional statements within it)
Andrew