The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |