Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
I have fact table "Test" and one disconnected table "Language".
Language table has contry and languagecode column where Belgium has two languagecode . we have RLS applied on this so that customer sees only their country language type in slicer .
So if customer selects languageType "nl-be" then it should filter responses for both language code "nl-be" and "en".
Similarly, on selection of "fr-be", data should filter for "fr-be" and "en".
Below is the sample data of Fact table
I have written below DAX measure to achieve this which works fine on latest data where we added translation for response .
For old data it should show everything on selection of any language type
I am looking forward to hear from you all. Please help me with this requirement / share idea how to achieve this please
Thanks in advance!
Solved! Go to Solution.
What if you inverted the logic and told it what not to include?
SWITCH (
SELECTEDVALUE ( 'Language'[LanguageType] ),
"nl-be", CALCULATE ( MAX ( Test[response] ), Test[languagecode] <> "fr-be" ),
"fr-be", CALCULATE ( MAX ( Test[response] ), Test[languagecode] <> "nl-be" ),
MAX ( Test[response] )
)
What if you inverted the logic and told it what not to include?
SWITCH (
SELECTEDVALUE ( 'Language'[LanguageType] ),
"nl-be", CALCULATE ( MAX ( Test[response] ), Test[languagecode] <> "fr-be" ),
"fr-be", CALCULATE ( MAX ( Test[response] ), Test[languagecode] <> "nl-be" ),
MAX ( Test[response] )
)
@AlexisOlson Great ! Thanks very much it's working abosultely fine with test data .
I will try in my real power bi dataset.
Thanks a lot for solution . Very much appreciated !
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |