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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
wolfgang2
Frequent Visitor

ValueFormatter ignoring culture

I have an issue with valueFormatter where it ignores the specified culture and always defaults to "en-US":

import { valueFormatter } from "powerbi-visuals-utils-formattingutils";
...
formatter = valueFormatter.create({ value: 1000, precision: 1, cultureSelector: "de-DE" });
formattedValue = formatter.format(3400);

This results in 3.4K instead of 3,4 Tsd.
1 ACCEPTED SOLUTION

If the separator/decimal symbols are right after making the changes, it's probably "working." Unfortunately, I'm not best placed to determine how far it goes for the units, as English is my first language. During testing, I have only really confirmed the units match what *I* might expect (although I have a rudimentary understanding of which separators are needed for various locales). It is known that there are some cases where, even if all locales are bundled, Power BI doesn't provide the correct locale to the visual host (e.g., Swiss German, or de-CH), but it does supply de-DE correctly.

 

MS uses the Globalize library to handle localization in powerbi-visuals-utils-formatingutils, and from a cursory look, I think the unit handling is not culture-specific. If you want a definitive answer, your best bet would be to check directly with MS (pbicvsupport@microsoft.com).

 

All the best,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

3 REPLIES 3
wolfgang2
Frequent Visitor

Hello, @dm-p 
Your suggestions fixed the issue but only partially. With the locales included, the valueFormatter is giving the correct thousands separator and decimal symbols based on the current locale. However, the units for thousand, million, billion (K, M, bn etc.) are not correct. Is this even supported? I decided to include specific locales. Thanks for the help anyway!

If the separator/decimal symbols are right after making the changes, it's probably "working." Unfortunately, I'm not best placed to determine how far it goes for the units, as English is my first language. During testing, I have only really confirmed the units match what *I* might expect (although I have a rudimentary understanding of which separators are needed for various locales). It is known that there are some cases where, even if all locales are bundled, Power BI doesn't provide the correct locale to the visual host (e.g., Swiss German, or de-CH), but it does supply de-DE correctly.

 

MS uses the Globalize library to handle localization in powerbi-visuals-utils-formatingutils, and from a cursory look, I think the unit handling is not culture-specific. If you want a definitive answer, your best bet would be to check directly with MS (pbicvsupport@microsoft.com).

 

All the best,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




dm-p
Super User
Super User

Hi @wolfgang2,

 

Are you specifying --all-locales (or bundling de-DE) when running developer mode or packaging your visual? Recently, the tools omit locales due to their size when packaging and you must specify which to include. You can manually specify locales to include by adding an empty stringResources file for your desired languages, as detailed here. Personally, I run my dev and package commands with --all-locales, as despite the size, this provides the best overall support for global users if publishing to AppSource. If your visual is intended for a private audience, then it may be better just to add the locales you need.

 

Cheers,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors