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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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/
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 17 | |
| 12 |