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
vitexo87
Post Prodigy
Post Prodigy

change type of measure that is concatenated with a text

I have a simple sum of the measure and to that extent I concatenate it with a text:


Pay Remains pay = "paid R$" & FORMAT (sum (Facts [Vl_Pago (Remains)]) - sum (Facts [Vl_Estornado (Remains)]) - sum (Facts [Vl_Devolvido (Remains)]);. "# ## 0 ")

 

if I do not concatenate the values I can not change the data type to concatenate but the option is disabled, how can I solve this?

 

Untitled1.png

6 REPLIES 6
Greg_Deckler
Super User
Super User

I may not understand your question completely but I will give it a shot. Once something is Text, all of those options should be grey'ed out because they only apply to numbers. What is it that you want to end up with? A number or text?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@vitexo87 In order to get 2 decimal places, you should change your formula to something like:

 

Pay Remains pay = "paid R$" & FORMAT (sum (Facts [Vl_Pago (Remains)]) - sum (Facts [Vl_Estornado (Remains)]) - sum (Facts [Vl_Devolvido (Remains)]);. "Currency")

or

 

Pay Remains pay = "paid R$" & FORMAT (sum (Facts [Vl_Pago (Remains)]) - sum (Facts [Vl_Estornado (Remains)]) - sum (Facts [Vl_Devolvido (Remains)]);. "# ## .00 ")

Your language settings may make you have to use "# ##,00" instead of "# ##.00". Here are the links that explain the FORMAT function and formats:

 

https://msdn.microsoft.com/en-us/library/ee634924.aspx

https://msdn.microsoft.com/en-us/library/ee634561.aspx

https://msdn.microsoft.com/en-us/library/ee634206.aspx


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler @Sean

 

it does not matter, because what matters is to present the calculated value concatenated with the word "Paid" and the data type number is of type money to two decimal places

 


I tried this however is error
Pay Remains pay = "paid R $" & FORMAT (sum (Facts [Vl_Pago (Remains)]) - sum (Facts [Vl_Estornado (Remains)]) - sum (Facts [Vl_Devolvido (Remains)]), "# ##. 0 ")

I'm guessing that your regional language settings are going to require a ";" instead of a "," in your formula, which is why you are getting the error. Is the problem with your original formula that it does not go to 2 decimal places, as in Sean's image?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Sean
Community Champion
Community Champion

@vitexo87 The formula looks good.

See Picture

Text Measure2.png

 

Sean
Community Champion
Community Champion

@vitexo87 try changing the ; to , before "#.##")

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.