Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |