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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.