cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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?

6 REPLIES 6
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?

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Super User

@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

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Post Prodigy

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 ")

Super User

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?

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

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

@vitexo87 The formula looks good.

See Picture

Community Champion

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.