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.
Hi all,
I'm trying to create a title based on what is selected on 3 slicers. These 3 slicers are hierarchies.
I want a title that shows which profit centre is selected on the slicer. If Profit centre level 3 is selected it will show "NZ Produce Categories" on the report.
If level 4 is selected the title will show "Covered Crops" rather than what is selected in level 3. As below:
Then when level 5 is selected it would show "Capsicums"
Here is the DAX I've tried so far but not working:
Measure Title =
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
(
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] )
)
)
)
Thanks in advanced!
Solved! Go to Solution.
@Anonymous managed to figure it out. ended up changing the order of the IF statement and it worked!
IF (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
"TG Fresh"
)
)
)
Thanks for your help.
@Anonymous managed to figure it out. ended up changing the order of the IF statement and it worked!
IF (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
&& HASONEVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 5 Text] ),
IF (
AND (
HASONEVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
HASONEVALUE ( 'Profit Center'[Profit Center Level 4 Text] )
),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 4 Text] ),
IF (
HASONEFILTER ( 'Profit Center'[Profit Center Level 3 Text] ),
SELECTEDVALUE ( 'Profit Center'[Profit Center Level 3 Text] ),
"TG Fresh"
)
)
)
Thanks for your help.
Hi @Anonymous can you share sample PBIX and expected result so I could help? Thanks!
In your first if criteria, why not use And to check the criteria together? Thanks!
Hi @Anonymous thanks for the reply! Are you able to provide an example using the AND function please? I don't think it will work as the first criteria I only want to show "Profit Centre level 3 text" value when this is the only slicer selected.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |