Forum Discussion

rjwijnen's avatar
rjwijnen
Frequent Visitor
3 years ago

UserCulture not working properly

Spoiler
Hello,
I was developing a thin-report which used the userculture() to change titles in my report. The thin-report needed to have a local model so i could use the field-parameters. Recently i discovered that my title measures only show the values for the EN-us culture instead of the NL-nl culture i am using. PBI desktop works fine but not in the service. The strange thing is that columnnames that are translated in the model do work.

It did work, but i don't know if it happend after i added the field parameters (which needed a local model) Any ideas or is this something that isn't supported?

2 Replies

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    Language settings in service are typically quite sensitive to the users language settings. I guess the behaviour would be explained by this:
    "

    • When used in calculated table and calculated column expressions, the result may differ depending on whether the table is in DirectQuery or Import mode. When in DirectQuery mode, the result is determined by the language (locale) specified in Language Settings in the Power BI service. The default in Language Settings specifies locale is determined by the user's browser language setting, which means the same calculated table or column can return different results depending on the browser language settings for each user. When in Import mode, the result is statically determined during refresh and will not vary at query time. For managed refreshes, such as scheduled or interactive, locale is not based on the user’s browser language setting but instead uses an invariant locale. The invariant locale, however, can be overridden by using the XMLA endpoint to specify a custom locale."


      USERCULTURE function (DAX) - DAX | Microsoft Learn



      So the assumption is that your tenant is in en-us and the users have their own settings.

    • rjwijnen's avatar
      rjwijnen
      Frequent Visitor

      I think i found the culprit. In the dynamic titles i am refering to an measure from the connected model or a visual is using a measure from the connected model in which the title is shown.

      Probably this is the reason: USERCULTURE returns the correct user locale when used in object expressions called from within the model such as measures, row-level security (RLS), and calculation items. However, it may not return the correct user locale when used in expressions from outside the model, such as queries and live-connect report measures.

       

      This report is connected with directquery to the main PBI dataset. Are there any workarounds/ideas i can use to make it work?