Forum Discussion
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:
And I used it as my date slicer. However it just gives 24 (12 months for 2 languages) blank values.
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.
6 Replies
- danextian
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.
- ceren1997Frequent Visitor
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: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.Could you please tell me where i am going wrong?
- danextian
Super User
Hi ceren1997
I was referring to this:
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
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.
- rajendraongole1
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
attached pbix file FYR.
Hope this helps.
- ceren1997Frequent Visitor
Thank you so much, this would also work perfectly!
- ceren1997Frequent 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.