I am creating a calculated column
in existing power BI report
. the calculated column
concatenates integer
& text
columns. I tried below query which give syntax error to me,
= Number.ToText(table1.[RegionID]) & " " & table1.[RegionName]
I tried some other conversion methods which were not a success. Someone please guide me how to achieve the above scenario in power bi
In the original case here, you'd use =FORMAT([Year], "General Number"] to return a year as a four-digit number, stored as text. Show activity on this post.
If you need to do this in the model (for instance, off of a calculated table), the correct DAX would be to use FIXED(<number>,3,1) to convert the number into string at 3 decimals and then RIGHT(<>,3) to retun the right 3 decimals. You can also do the concatenation by “Merge Columns” in Query Editor.
Select the column you want to extract the text string from (click on the "Recordno" heading and it should highlight the whole column). Then, in the "From Text" portion of the "Add Column" ribbon, click on "Extract", then "Text Between Delimiters" (see image below).
Make sure you have the correct format string.
Try this:
= FORMAT(table1.[RegionID], "#") & " " & table1.[RegionName]
Try
= "Text" & Number.ToText(Number)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With