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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
g-wizard
Frequent Visitor

If/AND/ElseIF

Hello Team, 

I am having difficulty converting this calc from tableau to pbi dax. Any suggestions?

They both come from different tables that are not related. One is an actual table and the other comes from my Measure Table(stored calculations area)

 

IF Attr([Channel Partner Customer Classification])="DM" AND [Annualized Sales]<500000 then 0
ELSEIF Attr([Channel Partner Customer Classification])="DM" AND[Annualized Sales]<1000000 then 2
ELSEIF Attr([Channel Partner Customer Classification])="DM" AND[Annualized Sales]<2000000 then 3
ELSEIF [Annualized Sales]<100000 then 0
ELSEIF [Annualized Sales]<250000 then 2
ELSEIF [Annualized Sales]>=1500000 then 10
END

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

a =
SWITCH (
    Attr[Channel Partner Customer Classification],
    "DM",
        SWITCH (
            TRUE (),
            [Annualized Sales] < 500000, 0,
            [Annualized Sales] < 1000000, 2,
            [Annualized Sales] < 2000000, 3
        ),
    SWITCH (
        TRUE (),
        [Annualized Sales] < 100000, 0,
        [Annualized Sales] < 250000, 2,
        10
    )
)

 

Note you have a logic gap in both halfs.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

a =
SWITCH (
    Attr[Channel Partner Customer Classification],
    "DM",
        SWITCH (
            TRUE (),
            [Annualized Sales] < 500000, 0,
            [Annualized Sales] < 1000000, 2,
            [Annualized Sales] < 2000000, 3
        ),
    SWITCH (
        TRUE (),
        [Annualized Sales] < 100000, 0,
        [Annualized Sales] < 250000, 2,
        10
    )
)

 

Note you have a logic gap in both halfs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.