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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Nishantjain
Continued Contributor
Continued Contributor

Custom Visual - Localization

Hi, 


I am trying to add localization to my custom visual and I am struggling to get the data labels to format as per the users locale. 

Here is what I am trying to do

As per this Microsoft Doc Example I am setting up the localization 

 

import { valueFormatter } from "powerbi-visuals-utils-formattingutils";

let iValueFormatter = valueFormatter.create({ value: 1e6 });

iValueFormatter.format(1234567890);

// returns: "1234.57M"

 

I am using the culture to format the data label in German

 

import { valueFormatter } from "powerbi-visuals-utils-formattingutils";

let iValueFormatter = valueFormatter.create({ cultureSelector: "de-DE", value: 1e6 });

iValueFormatter.format(1234567890);

 

I expect the output to be "1234,57 Mio" but I am getting "1234,57M". 


Not sure what I am missing and I can't find an example in any of the sample in github. Any help is much appreciated


Thanks

Nishant

1 ACCEPTED SOLUTION

Hi @Nishantjain,

My two cents: based on my experience with the library, you're using this as intended.

It's not stated in your OP, but is the format as you expect for a core visual for the same measure, but not for the formatting utils? If so, then I would suspect this is a bug in the formatting utils and you should probably raise an issue for it. Of note, I see there's currently an open issue specifically with this locale, so it might be worth reviewing/weighing-in on that.

Regards,

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

7 REPLIES 7
Anonymous
Not applicable

Hi @Nishantjain,

I checked the documents but not found they mention the compatibility about combine using two features.

In my opinion, I'd like to suggest you test with a single feature first to confirm they work on your side if you not mixed two features.

Regards,

Xiaoxin Sheng

@Anonymous Not sure which 2 features you are referring to. I am only trying to get the localization working.

 

Just need an example of how to make it work. 

Anonymous
Not applicable

HI @Nishantjain,

The two features mean the formatting and localization of custom visuals.  I'd like to suggest test two features alone to confirm the both of the two features work in your environment and the resulting style if they sensitive to the parameter orders.

import { valueFormatter } from "powerbi-visuals-utils-formattingutils";
let iValueFormatter = valueFormatter.create({ value: 1e6, cultureSelector: "de-DE" });
iValueFormatter.format(1234567890);

Regards,

Xiaoxin Sheng

@Anonymous Thanks for the suggestion. 

 

I have tried changing the parameter order but no luck. 

Anonymous
Not applicable

HI @Nishantjain,

It can be a reason if some internal issue occurs as 'dm-p' mentioned.
You can test to use different formatting parameters at the same time to confirm if this scenario appears when you work with multiple parameters or only appears if you combine with cultureSelector and other type formatters.

Regards,

Xiaoxin Sheng

Hi @Nishantjain,

My two cents: based on my experience with the library, you're using this as intended.

It's not stated in your OP, but is the format as you expect for a core visual for the same measure, but not for the formatting utils? If so, then I would suspect this is a bug in the formatting utils and you should probably raise an issue for it. Of note, I see there's currently an open issue specifically with this locale, so it might be worth reviewing/weighing-in on that.

Regards,

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)




Nishantjain
Continued Contributor
Continued Contributor

@dm-p Thanks for your reply. I believe I have got exactly the same issue as you mentiond in your post (valueFormatter ignores culture #36). 

 

The issue has been open for over 4 months so not sure what the priority is to fix this. 

 

Nishant

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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