Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello, I would like to check for title x gender invalidation.
I have two columns which has the value as below
Title | Gender |
Mr. | Male |
Encik | Male |
Mrs. | Female |
Miss | Female |
Ms. | Female |
Cik | Female |
Puan | Female |
I want to validate the values as follows.
Male = Encik , Mr.
Female = Cik , Miss , Mrs. , Ms. , Puan
If not then it is invalid.
For example
[Title] = "Mr." and [Gender] = "Female" (Invalid)
Blank values are also invalid
These are some of the Invalid values
Title | Gender |
Mr. | Female |
Male | |
Cik | |
Puan | Male |
Can you help me?
Solved! Go to Solution.
Good day @zahidah_mabd,
This can be easily achieved using a switch,
Switch(true(),
title in { "Encik", "Mr." } and Gender ="Male", "validmale,
title in { "Cik" , "Miss" , "Mrs." , "Ms." , "Puan" } and Gender ="Female","validfemale",
"invalid")
Proud to be a datanaut,
Marks as solution if this works for you.
Thanks and regards,
Atma.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Good day @zahidah_mabd,
This can be easily achieved using a switch,
Switch(true(),
title in { "Encik", "Mr." } and Gender ="Male", "validmale,
title in { "Cik" , "Miss" , "Mrs." , "Ms." , "Puan" } and Gender ="Female","validfemale",
"invalid")
Proud to be a datanaut,
Marks as solution if this works for you.
Thanks and regards,
Atma.