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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Lauraeire_81
Helper I
Helper I

Add text string to value

Hi

I am looking to add a text value to a Calculate value. 

CALCULATE(DISTINCTCOUNT('Report Results'[Critical areas])

 
I would like to add a text strings at both ends like this;
"The total is" & CALCULATE(DISTINCTCOUNT('Report Results'[Critical areas])&"critical areas".
 
Thanks for your help.
Regards,
Laura
 
2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@Lauraeire_81 To achieve this in DAX, you can use the & operator to concatenate text strings with your calculated value

 

"The total is " & CALCULATE(DISTINCTCOUNT('Report Results'[Critical areas])) & " critical areas"




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

johnt75
Super User
Super User

Another option is use a dynamic format string. The advantage of this approach is that the measure still returns a numeric value, which means you can use it in chart visualisations and also use it in other measures, e.g. to calculate averages.

To use a dynamic format string, choose Dynamic from the Format dropdown and use a DAX formula like

"The total is " & FORMAT(SELECTEDMEASURE(), "#,0") & " critical areas."

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

Another option is use a dynamic format string. The advantage of this approach is that the measure still returns a numeric value, which means you can use it in chart visualisations and also use it in other measures, e.g. to calculate averages.

To use a dynamic format string, choose Dynamic from the Format dropdown and use a DAX formula like

"The total is " & FORMAT(SELECTEDMEASURE(), "#,0") & " critical areas."
rohit1991
Super User
Super User

Hi @Lauraeire_81

 

To append a text string to a numeric value (like adding the label "critical error" to a number), you can use the & operator in DAX to concatenate text and numbers.

 

However, since you're working with a numeric measure, you'll first need to convert that number to text using FORMAT().

"The total is " & FORMAT([Report Result], "0.0") & " - critical error"

 

This will return something like: "The total is 98.5-critical error"

 

If you're using this in a card visual or tooltip, this should display correctly. Just make sure your measure is of type text, especially if you’re mixing strings and numbers.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
bhanu_gautam
Super User
Super User

@Lauraeire_81 To achieve this in DAX, you can use the & operator to concatenate text strings with your calculated value

 

"The total is " & CALCULATE(DISTINCTCOUNT('Report Results'[Critical areas])) & " critical areas"




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.