Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Maikeru
Helper II
Helper II

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
v-frfei-msft
Community Support
Community Support

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.

Hi Frank, 

 

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

 

Best regards

Michael

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.