Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi every one,
I'm new on power bi and I'm trying to figure out how I can make dynamic titles with these conditions:
" Dashboard for" &
- IF no departemnt is seleted (just the selected value of the colomn departments), I want to see "All departemnts"
- IF 1 department is selected then I want the departement name
- IF more than 2 departemnts are selected then it must show " Many departemnts"
Thanks in advance.
Solved! Go to Solution.
Hey @Anonymous ,
I would do it like that:
myDepartmentName =
"Dashboard for"
& SWITCH( TRUE(),
NOT ( ISCROSSFILTERED( MyTable[departments] ) ), " All departemnts",
COUNTROWS( ALLSELECTED( MyTable[departments] ) ) > 1, " Many departemnts",
SELECTEDVALUE( MyTable[departments] )
)
@selimovd No, I dont use hierarchy in any slicer. Actually I'm not working with slicers but filters. This is how it comes when I choose more than one departmnts.
Hey @Anonymous ,
that should still work.
Can you show me the measure you used? Maybe I can see a reason there.
Best regards
Dens
Sure. Here is the measure I used:
Hey @Anonymous ,
you didn't use the measure I proposed. That's the reason the result is different 😉
Try to use the one I proposed:
myDepartmentName =
"Dashboard for - "
& SWITCH( TRUE(),
NOT ( ISCROSSFILTERED( DimDep[Departmnts] ) ), "All departemnts",
COUNTROWS( ALLSELECTED( DimDep[Departmnts] ) ) > 1, "Many departemnts",
SELECTEDVALUE( DimDep[Departmnts]Hey )
)
Hello @Anonymous ,
You can try this measure:
dyn_title =
IF(NOT(ISCROSSFILTERED(T[Department])),
"All departments",
SELECTEDVALUE(T[Department], "Many departments"))
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hey @Anonymous ,
I would do it like that:
myDepartmentName =
"Dashboard for"
& SWITCH( TRUE(),
NOT ( ISCROSSFILTERED( MyTable[departments] ) ), " All departemnts",
COUNTROWS( ALLSELECTED( MyTable[departments] ) ) > 1, " Many departemnts",
SELECTEDVALUE( MyTable[departments] )
)
Thanks for your assistance @selimovd. I try your example, but when I select more than 1 value, it's showing me "All departmnts" instead of "Many departmnts". How can I fix that please?
Hey @Anonymous ,
do you use a hierarchy in your slicer? Can you send me a screenshot of your solution?
For me it works, like this you wanted it, right:
Best regards
Denis
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |