Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
vanhell54321
Frequent Visitor

Need help with DAX formula to mark the shape

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

 

NationFruits
1Banana
1Orange
2Banana
3Orange
4Banana
4Orange

 

 

 

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. 


NationFruitsShape
1BananaBoth
1OrangeBoth
2Bananalong
3Orangecircle
4BananaBoth
4OrangeBoth

 

Thanks!

 

Regards,

Van

2 REPLIES 2
Anonymous
Not applicable

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/

 

 

Anonymous
Not applicable

Try something like this

I am not sure this will work or not but give try

Column=
Var check=Calculate(distinctcount(table[fruit]),allexcept(table,table[nation]))
Return
Switch(true(),check=2,
If(table[fruit]="orange","circle","long"),"both")

Thanks,
Pravin

If it resolves your problem mark it as a solution and give Kudos.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.