Forum Discussion
Marshmallow
1 year agoHelper II
Complex dynamic text
Hi, I need help with creating dax for dynamic title. The outcome I would like to display is: "**When a selected region is selected in the filter, then the text will display --> [Selected Region] has ...
- 1 year ago
Create a new measure:
DynamicTitle =
VAR SelectedRegion = SELECTEDVALUE('YourTable'[Region])
VAR BreachCount = CALCULATE(COUNTROWS('YourTable'), 'YourTable'[Region] = SelectedRegion)
VAR BreachType = SELECTEDVALUE('YourTable'[Type of Breach])
VAR BreachRectified = SELECTEDVALUE('YourTable'[Breach Rectified])
RETURN
IF(
ISBLANK(SelectedRegion),
"Please select a Region to display the compliance information",
SelectedRegion & " has " & BreachCount & " breach recorded. The type of breach recorded is " & BreachType & " and the breach " &
IF(BreachRectified = "Yes", "has been", "has not been") & " rectified."
)Use this measure in a card visual to display the dynamic title.
💌If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Kedar_Pande
1 year agoSuper User
Create a new measure:
DynamicTitle =
VAR SelectedRegion = SELECTEDVALUE('YourTable'[Region])
VAR BreachCount = CALCULATE(COUNTROWS('YourTable'), 'YourTable'[Region] = SelectedRegion)
VAR BreachType = SELECTEDVALUE('YourTable'[Type of Breach])
VAR BreachRectified = SELECTEDVALUE('YourTable'[Breach Rectified])
RETURN
IF(
ISBLANK(SelectedRegion),
"Please select a Region to display the compliance information",
SelectedRegion & " has " & BreachCount & " breach recorded. The type of breach recorded is " & BreachType & " and the breach " &
IF(BreachRectified = "Yes", "has been", "has not been") & " rectified."
)
Use this measure in a card visual to display the dynamic title.
💌If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
- Marshmallow1 year agoHelper II
Hi Kedar, it is almost there. The Breach Type won't be a filter selection so we can't use selectedvalue. what's the best way to say
_var BreachType = if([BreachRectified]="Yes", "Yes", "No")
so in the return it will find the column 'BreachRectified", if it has yes, then the breach is rectified, else no.