cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Maikeru Regular Visitor
Regular Visitor

Number format with variable nb of decimals + adjusting to US/EU browser regional configuration

Hi,

 

I would like to display a quantity measure with a To/kg toggle which would convert the measure accordingly and matches the following behaviour.

 

 

1. When displayed in To, the measure should display 3 decimals but when displayed in Kg it should show 0 decimals. I think this can be easily achieved with the FIXED function.

Fixed function w/ comma = 
SWITCH(TRUE(),
    UoM[UoM selected]="KG", FIXED([Quantity in UoM], 0, 0),
    UoM[UoM selected]="TO", FIXED([Quantity in UoM], 3, 0), "")

2. When displayed on a US internet browser, the measure should have comma as thousands separator and a dot as a decimal separator, This is is exactly what the FIXED function do!.

However when displayed on a European internet browser, the measure shoudl have a blank as thousands separator and a comma as a decimal separator, Unfortunately it seems that the FIXED function doesn't adapt automatically to the browser local setting.

 

A work around would be to define another measure to substitute the separators like so:

Fixed function w/ comma substitute = 
SWITCH(TRUE(),
UoM[UoM selected]="KG", SUBSTITUTE(SUBSTITUTE(FIXED([Quantity in UoM], 0, 0), ",", " "), ".", ","),
UoM[UoM selected]="TO", SUBSTITUTE(SUBSTITUTE(FIXED([Quantity in UoM], 3, 0), ",", " "), ".", ","), "")
Then create a US/EU toggle to let the user switch between the display format.

 Image.png

Although it "works" I am quite reluctant to go this way because it means more heavier dax code and also have the user toggle the display themselves.

 

I have also played with the FORMAT function and the predefined numeric formats but none of them are making the grade.

 

Any suggestion would be greatly appreciated.

 

https://drive.google.com/open?id=1Wat69FyvwTzcfhRSanNo9eTlMqQTFlmy

 

Best regards

2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Number format with variable nb of decimals + adjusting to US/EU browser regional configuration

Hi @Maikeru,

 

Based on my test, it is not possbile to achieve your gola by browser regional configuration . You can come up a new idea about that and add your comments there to improve Power BI and make this feature coming sooner.

https://ideas.powerbi.com/forums/265200-power-bi-ideas

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Maikeru Regular Visitor
Regular Visitor

Re: Number format with variable nb of decimals + adjusting to US/EU browser regional configuration

Hi Frank, 

 

Thank you very much for having taken the time to look into this issue.

 

Best regards

Michael

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)