Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
87 | |
79 | |
62 | |
61 | |
60 |
User | Count |
---|---|
166 | |
114 | |
99 | |
73 | |
65 |