cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
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 other members 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
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 3,200 guests
Please welcome our newest community members: