Forum Discussion

Marshmallow's avatar
Marshmallow
Helper II
1 year ago
Solved

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 ...
  • Kedar_Pande's avatar
    1 year ago

    Marshmallow 

    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