Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Pbiuserr
Post Prodigy
Post Prodigy

DAX measure to dynamic title

Hello, 

Trying to do dynamic formula however got some obstacles


My DAX formula is as presented

 

DynamicTitle =
VAR _Count = COUNTROWS(VALUES('data'[PROJECT_KEY]))
VAR Concat = CONCATENATEX(VALUES('data'[PROJECT_KEY]),[PROJECT_KEY]," ,")
RETURN
IF(_Count = COUNTROWS(VALUES('data'[PROJECT_KEY])), "All selections",
IF(_Count >5 "Above 5 selections",Concat))

COUNTROWS(VALUES('data'[PROJECT_KEY])) gives proper amount of projects key's. The point is I think it should be differently inserted here IF(_Count = COUNTROWS(VALUES('data'[PROJECT_KEY])), "All selections" - so it says that if all project keys are selected then (..)

Any suggestions?
 
1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

As things stand your _count and "All selections" have the same syntax.  If you include ALL in your DAX when it comes to "All selections" your code should work. E.g. IF(_Count = COUNTROWS(VALUES(ALL('data'[PROJECT_KEY]))), "All selections",





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

As things stand your _count and "All selections" have the same syntax.  If you include ALL in your DAX when it comes to "All selections" your code should work. E.g. IF(_Count = COUNTROWS(VALUES(ALL('data'[PROJECT_KEY]))), "All selections",





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello,

It works, thank you 🙂 just as i though

 

I have one additional problem though. When I filter by other slicer, the name of the label changes automatically as well. Can I prevent it, so only filtering this one particular slicer (project key) enables to change title dynamically?

edit: okay I found out edit interaction option

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.