Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a dataset with names and ages. I need to show three age groups: Under 18, 18-64, 65 and above. Can someone give me some pointers for setting this up? It seems like it should be relatively simple but none of the things I've tried work. I tried creating a conditional column but it won't work in direct query mode. I also tried a DAX formula but it kept giving me an error.
AgeGroups = IF(FamilyMember[Age] < 18, "1) Under 18",If (FamilyMember[Age] <=17 and FamilyMember[Age] >=65),"2)18 -65", If (FamilyMember[Age] >= 65,"3) Over 65",))
Solved! Go to Solution.
Hi @achristopherson ,
You can create a column:
Column =
SWITCH(
TRUE(),
FamilyMember[Age] < 18, "1) Under 18",
FamilyMember[Age] >= 18 && FamilyMember[Age] < 65, "2)18 -65",
"3) Over 65"
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @achristopherson ,
You can create a column:
Column =
SWITCH(
TRUE(),
FamilyMember[Age] < 18, "1) Under 18",
FamilyMember[Age] >= 18 && FamilyMember[Age] < 65, "2)18 -65",
"3) Over 65"
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try:
AgeGroups =
SWITCH(TRUE(),
FamilyMember[Age] < 18, "1) Under 18",
FamilyMember[Age] >= 65,"3) Over 65",
"2)18 -65"
)
Try these two patterns.
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 39 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |