Forum Discussion
Complex dynamic text
- 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
Hi Marshmallow
The logic of needed dax is similar to :
title =
if(SELECTEDVALUE('Table'[Region]) = blank(),"Please select Region to display the compliance information",
if(MAX('Table'[Breach Rectified])= "Yes",SELECTEDVALUE('Table'[Region]) & " has "& CALCULATE(DISTINCTCOUNT('Table'[Type of Breach]),ALLEXCEPT('Table','Table'[Region]))&" breach recorded. The type of breach is : " & CONCATENATEX(values('Table'[Type of Breach]),'Table'[Type of Breach],",")&"has been rectified",SELECTEDVALUE('Table'[Region]) & " has "& CALCULATE(DISTINCTCOUNT('Table'[Type of Breach]),ALLEXCEPT('Table','Table'[Region]))&" breach recorded. The type of breach is : " & CONCATENATEX(values('Table'[Type of Breach]),'Table'[Type of Breach],",")&"has been not rectified"))
Here’s the translation:
But there might be some misunderstandings with the calculations inside that you didn’t consider.
You're filtering only by region, and it’s possible that the Rectified field could have both "Yes" and "No" values. It’s also not clear how to handle counting of the branches, etc.
In any case, from the base I’ve built, you’ll be able to get what you need once you adjust the calculation logic.
The pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly