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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Rubal
Helper II
Helper II

if or a switch statement

Hi ,

 

I am new to Power BI and need some help with the below case. Appreciate if someone can help with the DAX formula for the case. I am not sure IF of SWITCH statement works best for the below case. 

Please Note: I will have "AAA" and "BBB" as part of a visual filter too. Thank You.

 

(CASE

WHEN Field1 = "AAA" then "RETAIL * GROWTH FACTOR" AND "ONLINE * GROWTH FACTOR"

ELSE

WHEN Field1 = "BBB" then "RETAIL" AND "ONLINE"

END)

 

1 ACCEPTED SOLUTION

Hi @Rubal ,

It seems that you need to chang your query to dax in power bi.

Based on your logic, we could create the dax like below.

=
IF (
    Field1 = "AAA",
    "RETAIL * GROWTH FACTOR" && "ONLINE * GROWTH FACTOR",
    IF ( Field1 = "BBB", "RETAIL" && "ONLINE" )
)

However, more details about your scenario will be more helpful.

If it is convenient, could you share your data sample which could reproduce your scenario so that we could help further on it?

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Rubal 

Have you read the documentations?
Cheers!
A

yes, I have. Need the formula example for my specific case though

Hi @Rubal ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share some data sample and your desired output.

Best  Reagards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Rubal ,

It seems that you need to chang your query to dax in power bi.

Based on your logic, we could create the dax like below.

=
IF (
    Field1 = "AAA",
    "RETAIL * GROWTH FACTOR" && "ONLINE * GROWTH FACTOR",
    IF ( Field1 = "BBB", "RETAIL" && "ONLINE" )
)

However, more details about your scenario will be more helpful.

If it is convenient, could you share your data sample which could reproduce your scenario so that we could help further on it?

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.