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
madhushree
Frequent Visitor

How to change character used to seperate thousands and decimals ?

How to change character used to seperate thousands and decimals ?

For example:

In general we use commas : 43,987.09

But i need to convert it to 43.987,09 in power BI.

How can this be done?

7 REPLIES 7
pschommer
Helper II
Helper II

You changed the requirements a little bit. Here's what I did to solve your problem:

Capture.PNG

 

 

OriginalDec is the decimal number in the source file. It's the only column that is native to the data source. The other values are added columns.

 

OriginalTxt = FORMAT([OriginalDec],"###,###,###.#####")                      'modify to fit the largest number in your data

Millions = INT([OriginalDec]/1000000)

Thousands = INT([OriginalDec]/1000) - IF([Millions]>0,[Millions]*1000,0)

Ones = INT([OriginalDec] - (INT([OriginalDec]/1000)*1000))

Decimal = IF(RIGHT([OriginalTxt],1)=".","",RIGHT([OriginalTxt],LEN([OriginalTxt])-SEARCH(".",[OriginalTxt])))

 

It was easier for me to visualize and test by leaving the sections of the new "number" as separate columns.

 

The final result is a string concatenating the above parts together.

NewTxt = IF([Millions]>0,[Millions] & ".","") & IF([Thousands]>0,[Thousands] & ".","") & [Ones] & IF([Decimal]<>"","," & [Decimal])

 

That worked with examples you provided and a couple I threw in.

Eric_Zhang
Employee
Employee


@madhushree wrote:

How to change character used to seperate thousands and decimals ?

For example:

In general we use commas : 43,987

But i need to convert it to 43.987 in power BI.

How can this be done?


@madhushree

The locale setting determins how the thousands and decimals seperator show.

  • To have that format in Power BI Desktop, you'll have to change the locale setting of your PC.
  • To have that format in Power BI Service, change the language(In Power BI Service->setting ->Language).
    eg, in my test case, I changed my Power BI Service language to nederlands, you'll have to change it to your language which has that format. See a snapshot in Power BI Service.
    Capture.PNG

Hi ,

If i change the language then whole GUI languages also changes, which i dont want.

Thanks,

Madhushree

pschommer
Helper II
Helper II

You can certainly do some string manipulation to format it the way you want, but you will completely lose the value, as @vanessafvg eluded to.

 

In Excel it would look something like this:

=INT(A1/1000) & "." & A1-(INT(A1/1000)*1000)

where A1 is a column name in Power BI.

 

This works for all numbers if you only want one period in the result. It will only work for numbers up to 999,999 if you want multiple periods to substitute for commas. The formula will get messier if you want multiple periods.

In order to always get 3 digits after the decimal point, the formula would have to be altered slightly:

NewValue = INT([DecimalValue]/1000) & "." & FORMAT([DecimalValue] - (INT([DecimalValue]/1000)*1000),"000")

Hi

 

I also need the format to be like this:

1.04 ---> 1,04

 

Thanks

Madhushree

vanessafvg
Super User
Super User

@madhushree when you say how can you convert it, are you wantign to change the value of it to a decimal or are you wanting to change the format?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.