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.
Hello Team,
@sevenhills @PaulDBrown @amitchandak @SpartaBI @Ashish_Mathur @johnt75
I have slicer named cost category in which i have 3 fields. My title needs to dynamically change if based on my slicer selection.
IF i select S/T and G/A - title should be " Summary for "SG&A"
IF i select S/T and G/A and COGA - title should be " Summary for COGA and SG&A"
IF i select any one of the slicers it should display " Summary for [selected single slicer value]
Cost category |
COGS |
S/T |
G/A |
Can anyone please help me with the measure I have really been trying long for this
Solved! Go to Solution.
See if this works for you:
Title =
VAR _SGA = { "S/T", "G/A" }
VAR _All =
ALLSELECTED ( Slicer[Cost Category] )
RETURN
SWITCH (
TRUE (),
NOT ( ISFILTERED ( Slicer[Cost Category] ) ), "",
COUNTROWS ( _All ) = 3, "SG&A & COGS",
COUNTROWS ( INTERSECT ( VALUES ( Slicer[Cost Category] ), _SGA ) ) = 2, "SG&A",
CONCATENATEX ( VALUES ( Slicer[Cost Category] ), Slicer[Cost Category], ", " )
)
Proud to be a Super User!
Paul on Linkedin.
Hi @gunshruthi,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
You can go with @PaulDBrown solution.
A small variation to his code
Table:
Title =
var _val = CONCATENATEX ( VALUES ( 'Cost Category'[Cost Category]) , [Cost Category] , ", ")
return switch (
TRUE()
, NOT ( ISFILTERED ( 'Cost Category'[Cost Category] ) ), "Summary"
, _val = "G/A, S/T", "Summary for SG&A"
, _val = "COGS, G/A, S/T", "Summary for SG&A and COGS"
, "Summary for " &_val
)
See if this works for you:
Title =
VAR _SGA = { "S/T", "G/A" }
VAR _All =
ALLSELECTED ( Slicer[Cost Category] )
RETURN
SWITCH (
TRUE (),
NOT ( ISFILTERED ( Slicer[Cost Category] ) ), "",
COUNTROWS ( _All ) = 3, "SG&A & COGS",
COUNTROWS ( INTERSECT ( VALUES ( Slicer[Cost Category] ), _SGA ) ) = 2, "SG&A",
CONCATENATEX ( VALUES ( Slicer[Cost Category] ), Slicer[Cost Category], ", " )
)
Proud to be a Super User!
Paul on Linkedin.
Thank you so much @PaulDBrown for the solution
Thanks @sevenhills for your valuble time
@sevenhills Thanks for the DAX but its not the one which i have requested
I need dynamic title which is coming from only single slicer as you can see in the screenshot.
The values in the slicer are coming from single column based on the selction of values inside slicer my Title should change.
Can you please help me with the DAX query
Will be really helpfull. Thank you so much
I see that you want dynamic title with three kinds of slicers. If it is me, I will do like this ... each slicer must be based on a column. I used the column in the DAX to get the dynamic title.
Let us know if it works for your needs:
Dynamic Title = "Summary for " &
SWITCH (
TRUE (),
-- Three condition check
HASONEVALUE (Table[col1]) && HASONEVALUE(Table[col2]) && HASONEVALUE (Table[col3]) , "COGA and SG & A",
-- Two condition check
HASONEVALUE (Table[col1]) && HASONEVALUE(Table[col2]), "SG & A",
-- any selected value
SelectedValue('Table'[Col1], "") &
SelectedValue('Table'[Col2], "") &
SelectedValue('Table'[Col3], "")
-- Default, added extra, not needed
& ""
)
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 |
---|---|
108 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
104 | |
80 | |
66 |