Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Dear power BI community,
I have the following columns I need to make a new calculated column using DAX formula.
The following data looks like the below
Nation | Fruits |
1 | Banana |
1 | Orange |
2 | Banana |
3 | Orange |
4 | Banana |
4 | Orange |
I need to create a new column shape that marks orange as circle and Banana as long and if the Nation as both the fruits the column marks it as both.
Nation | Fruits | Shape |
1 | Banana | Both |
1 | Orange | Both |
2 | Banana | long |
3 | Orange | circle |
4 | Banana | Both |
4 | Orange | Both |
Thanks!
Regards,
Van
Hi @vanhell54321 ,
Use the below Dax formula:
Shape =
VAR CountFruits =
CALCULATE ( COUNT ( table[fruit] ), ALLEXCEPT ( table, table[nation] ) )
RETURN
SWITCH (
TRUE (),
CountFruits = 2, IF ( table[fruit] = "orange", "circle", "long" ),
"both"
)
Regards,
Gaurav Raj Singh
LinkedIN : https://www.linkedin.com/in/gauravrajsingh/