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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
jothimeena
Regular Visitor

DAX

When to use calculated column and measure while using switch fn in DAX?

 

 

1 ACCEPTED SOLUTION
GeraldGEmerick
Super User
Super User

@jothimeena Many people say that you should never use a DAX calculated column but should rather create calculated columns in Power Query Editor. If you are using a SWITCH statement, I would go with a measure over a Power Query Editor custom column because Power Query does not have a switch statement equivalent but instead you would need to use nested if then else statements.

 

If you can provide additional information on what exactly you are trying to do then I can probably be of more help.

View solution in original post

2 REPLIES 2
FBergamaschi
Super User
Super User

Can you clarify what you mean?

are you asking

1) when to use SWITCH in a measure or a column?

or

2) how to choose between a column or a measure when SWITCH in involved in your code

?

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

GeraldGEmerick
Super User
Super User

@jothimeena Many people say that you should never use a DAX calculated column but should rather create calculated columns in Power Query Editor. If you are using a SWITCH statement, I would go with a measure over a Power Query Editor custom column because Power Query does not have a switch statement equivalent but instead you would need to use nested if then else statements.

 

If you can provide additional information on what exactly you are trying to do then I can probably be of more help.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.