Forum Discussion

jochemd96's avatar
jochemd96
Frequent Visitor
4 years ago
Solved

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 _ kalyj

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

3 Replies