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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DiegoCorriendo
Frequent Visitor

Internationalize Legends in graphs

Hi,

Is it possible to change dynamically legends in graphs as what is done with titles in this example?.

https://powerbiuniversity.com/informes-multilenguaje-formato-condicional-los-titulos/

What i need is to change legend names dinamically in the same way the title does. This is, when "es" is selected, Legend names turn into Spanish language.

 

And when "en" is selected the value shown was in English language.

 

Please help.

 

Thanks in advance and Regards.

1 ACCEPTED SOLUTION

Hi @DiegoCorriendo ,

 

We can create a calculated column in the fact table as below to get another language for label.

 

es = 'Table'[legend] &" es"

Then I enter a table like this.

2.PNG

 

Based on the table, to create another two calculated table.

en = FILTER(lan2,lan2[language] = "en")
esf = FILTER(lan2,lan2[language]="es")

To create realationship between tables like this.

re.PNG

 

After that, we can achieve our goal by a measure.

 

Measure =
VAR a =
    MAX ( lan2[language] )
RETURN
    IF (
        a = "en",
        CALCULATE (
            SUM ( 'Table'[value] ),
            USERELATIONSHIP ( 'Table'[legend], en[lenegdlan] )
        ),
        IF (
            a = "es",
            CALCULATE (
                SUM ( 'Table'[value] ),
                USERELATIONSHIP ( 'Table'[es], esf[lenegdlan] )
            )
        )
    )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @DiegoCorriendo ,

 

 We can set conditional formatting of tile like this. Then we can change the tile name and legend as we excepted.

 

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi  and thanks for quick response.

I think maybe i don't have expressed correctly my problem.

What I need to translate are Legend values (Label, Label2 in graph) depending on value selected for the language.
That is, for "en" (English) value in the selection List it should be shown Label, Label2, but for "es" (Spanish) value or whatever, it should be shown it correspondant value in that language.

Title is already using conditional formatting as u point.

Thanks in advance.

Regards.

Hi @DiegoCorriendo ,

 

We can create a calculated column in the fact table as below to get another language for label.

 

es = 'Table'[legend] &" es"

Then I enter a table like this.

2.PNG

 

Based on the table, to create another two calculated table.

en = FILTER(lan2,lan2[language] = "en")
esf = FILTER(lan2,lan2[language]="es")

To create realationship between tables like this.

re.PNG

 

After that, we can achieve our goal by a measure.

 

Measure =
VAR a =
    MAX ( lan2[language] )
RETURN
    IF (
        a = "en",
        CALCULATE (
            SUM ( 'Table'[value] ),
            USERELATIONSHIP ( 'Table'[legend], en[lenegdlan] )
        ),
        IF (
            a = "es",
            CALCULATE (
                SUM ( 'Table'[value] ),
                USERELATIONSHIP ( 'Table'[es], esf[lenegdlan] )
            )
        )
    )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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