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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ceren1997
Frequent Visitor

SelectedValue as Slicer for MultiLanguage Reports

Hi,

 

I'm working on creating a multi language report. Since our initial report has a lot pages, i am trying to build a report where i use a language slicer and dynamically change the values.

 

However I dont know how to achieve it on slicers. I've tried to create a calculated column:

TranslatedMonth =
VAR SelectedLanguage = SELECTEDVALUE('Language'[LanguageId])
RETURN
SWITCH(
    SelectedLanguage,
    1, 'Date'[MonthName],
    2, 'Date'[MonthName_EN]
)
And I used it as my date slicer. However it just gives 24 (12 months for 2 languages) blank values.
 
Is there a way to achieve this or do i need bridge tables etc? I dont want to change the table structure much, im looking for more of a dynamic solution using measures.
 
Many thanks in advance!
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @ceren1997 

Calculated columns don't respond to slicer selections. Within the calculated column context, it encounters a blank value since SELECTEDVALUE returns blank by default. It remains unaware if any selection has been made in the slicer.

Try using field parameters to switch between columns using a slicer.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
ceren1997
Frequent Visitor

Thanks @danextian your approach was very beneficial!

 

I've also figured out an additional solution.

 

I've use a field parameter for my date slicer where i have both MonthName and MonthName_EN columns. 

 

I've noticed MonthName takes the id 0 and monthname_EN takes the id 1 and there is no way to alter that.

 

So, i've updated my language table in accordance and managed the relationship between the date field parameter and language table.

 

Now, it works as desired. 

 

rajendraongole1
Super User
Super User

Hi @ceren1997 - you can create bridge table if you dont have it as like below. 

Language =
DATATABLE(
"LanguageId", INTEGER,
"LanguageName", STRING,
{
{1, "English"},
{2, "OtherLanguage"}
}
)

 

after that instead of calculated column, create a measure as like below to work dynamically switch the MonthName based on the selected language. This measure can then be used in your slicers or visuals

 

rajendraongole1_0-1737618764780.png

 

attached pbix file FYR.

rajendraongole1_1-1737618785643.png

 

 

Hope this helps. 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you so much, this would also work perfectly!

danextian
Super User
Super User

Hi @ceren1997 

Calculated columns don't respond to slicer selections. Within the calculated column context, it encounters a blank value since SELECTEDVALUE returns blank by default. It remains unaware if any selection has been made in the slicer.

Try using field parameters to switch between columns using a slicer.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian,

Thank you so much for this brilliant idea! 


I've never worked with parameters before so im a little confused. Here is my language table:

ceren1997_0-1737619854643.png

And my date table simply has MonthName, MonthName_EN columns in addition to necessary date columns.

Ive created 2 parameters, one for the languageid and the other is for monthnames, ive added both columns to the parameter. 
However i couldnt manage to create relationship between those parameters.

ceren1997_1-1737619985194.png

Could you please tell me where i am going wrong?

Hi @ceren1997 

 

I was referring to this:

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

danextian_0-1737622797590.gif

 

Just make sure that single select is enabled for the slicer to avoid showing multiple columns at a time.

It still is in preview so you may need to enable it first.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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