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 All,
I have a small scenario, where I would like to group the nationality into below categories.
If Nationality="Indian" then "A1"
if Nationality = "Australian" then "A2"
If Nationality = "American" then "A3"
else "Other"
How would acheive it by using DAX measure.
Kindly note, this can be achieved by adding group to the table, but I want to achieve this by measure.
Regards,
Sonu
Solved! Go to Solution.
Hi @sonuojha1 ,
You can add the following measure:
Nationality group =
SWITCH (
SELECTEDVALUE ( Table[Nationality] ),
"Indian", "A1",
"Australian", "A2",
"American", "A3",
"Other"
)
Be aware that being a measure you need to have the nationality on your visualization otherwise these will not work properly, further more since it's a measure you cannot use it has a axis on visualizations or columns in a matrix visualization.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @sonuojha1 ,
You can add the following measure:
Nationality group =
SWITCH (
SELECTEDVALUE ( Table[Nationality] ),
"Indian", "A1",
"Australian", "A2",
"American", "A3",
"Other"
)
Be aware that being a measure you need to have the nationality on your visualization otherwise these will not work properly, further more since it's a measure you cannot use it has a axis on visualizations or columns in a matrix visualization.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks Miguel.
I have noted your comment.
Regards,
Sonu
User | Count |
---|---|
83 | |
77 | |
70 | |
69 | |
54 |
User | Count |
---|---|
106 | |
96 | |
90 | |
79 | |
68 |