Forum Discussion
Using a column based on language
Hello,
I recently started creating PowerBI reports and now I start to get stuck a little. I think I have a fairly easy to solve problem, but I can't get the hang of it.
I have the following dataset:
Column A contains an index for sorting out the rows. This index will be nearly invisible in the report.
Column B contains an English P&L statement description.
Column C contains the Dutch P&L statement description.
Column D contains the displaycode which refers to a mapping table, which then refers to values, but that's not important for now. That part works fine.
I also have a slicer based on this table:
Whenever I select "Nederlands" I want my report to show the Dutch descriptions (column C) and whenever I select "Engels", I want it to show English descriptions (column B).
I already tried making an extra column with the following formula...
Column = IF(
SELECTEDVALUE(Talen[Taal]) = "Nederlands",
Display[DisplayOmschrijving],
Display[DisplayDescription]
)
... but that does not seem to work as it always returns the English value.
Is there any solution to this? What am I doing wrong?
Any help would be appreciated. Thanks a lot!
Hi jochemd96 ,
You can use a measure like this:
Measure = IF ( SELECTEDVALUE ( 'Talen'[Taal] ) = "Nederlands", MAX ( 'Display'[DisplayOmschrijving] ), MAX ( 'Display'[DisplayDescription] ) )Then put the column Index and this measure into a visual, it works.
Here's the difference of calculated column and measure:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Greg_DecklerCommunity Champion
jochemd96 Columns are not dynamic based on user input but are only calculated during load/refresh. I wrote an entire blog series on multi-language support here:
https://community.powerbi.com/t5/Community-Blog/Localizing-the-Data-Model-Part-1/ba-p/2062997
https://community.powerbi.com/t5/Community-Blog/Localizing-the-Data-Model-Part-2/ba-p/2065547
https://community.powerbi.com/t5/Community-Blog/Localizing-the-Data-Model-Part-3/ba-p/2071522
https://community.powerbi.com/t5/Community-Blog/Localizing-the-Data-Model-Part-4/ba-p/2095284
- jochemd96Frequent Visitor
Thanks, I already suspected such thing. What do you suggest to solve this problem?
- v-yanjiang-msftCommunity Support
Hi jochemd96 ,
You can use a measure like this:
Measure = IF ( SELECTEDVALUE ( 'Talen'[Taal] ) = "Nederlands", MAX ( 'Display'[DisplayOmschrijving] ), MAX ( 'Display'[DisplayDescription] ) )Then put the column Index and this measure into a visual, it works.
Here's the difference of calculated column and measure:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.