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
marilaitala
Advocate I
Advocate I

Power BI JavaScript API userculture does not work correctly today multi-language reports

This is very impressive webinar about multilanguage reports

Join us! Power BI Dev Camp – Thursday 22 July, 2021- Building Multi-language Reports for Power...

 

 Are there any changes happening in the Power BI JavaScript API? Live demo (https://multilanguagereportdemo.azurewebsites.net/) does not work correctly today. UserCulture funktion return 'en-US' value for all report sizes. Yesterday it worked correctly.

marilaitala_0-1628768304041.png

 

I made my own PBI multi-language report with the same technigue: yesterday it worked correctly, but today userculture return 'en-US' value to all.

5 REPLIES 5
marilaitala
Advocate I
Advocate I

Hi,
thank you so much for this advice. We have just making these config changes to our own embed report, but we noticed about hour ago that live demo report works correct again! Power BI Embedded sample (multilanguagereportdemo.azurewebsites.net)

Has Microsoft made any corrections to "userculture"-funktion due this ticket? We hope that it works correctly at all times.

Best regards,

Mari

marilaitala
Advocate I
Advocate I

Hi Liang,

Ted Pattison, Microsoft principal program manager with Power BI, has made this  live demo using import mode
Power BI Embedded sample (multilanguagereportdemo.azurewebsites.net) 

Earlier in this live demo UserCulture funktion return correct value, but from Thursday 12 of August userculture return 'en-US' value for all cases. This same Power BI Desktop file works fine in PowerBI Desktop and userculture return correct value in there.

 

Best Regards,
Mari

V-lianl-msft
Community Support
Community Support

Hi @marilaitala ,

 

 

In import mode, does the userculture function return the correct value?

If you connect to SSAS using a live connection,please try configuring the language of each user in a table and implement the translations in a similar way of the Row Level Security.


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

We experience the same issue. Is there a solution yet?

When we embed a report we perform the following:-

    const lang = this.user ? this.user.profile['locale'] : 'en-GB';

 

    const config: any = {

      type: 'report',

      id: this.id,

      embedUrl: this.embedUrl,

      accessToken: this.accessToken,

      tokenType: pbi.models.TokenType.Embed,

      settings: {

        filterPaneEnabled: true,

        navContentPaneEnabled: true,

        layoutType: this.layout,

        localeSettings: {

          language: lang,

          formatLocale: lang

        }

      }

    };

    const divElement: HTMLElement = <HTMLElement>this.powerBIReports.nativeElement;

    this.powerbi.reset(divElement);

    this.report =  this.powerbi.embed(divElement, config);

 

 

You can see from the example above that we are passing a culture in the localeSettings

 

Within our report itself we have a dax expression similar to:-

VAR UC = CALCULATE(MIN(usercultures[Locale]),FILTER(usercultures,usercultures[Code] = USERCULTURE()))

Return  UC

 

The USERCULTURE() no longer resolves to the culture passed in when embedded (see highlighted red), it evaluates as en-US

 

We have also logged this as a ticket with Microsoft.

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.

Top Solution Authors