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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Arklur
Resolver II
Resolver II

New (calculated) column: SQL Query or DAX? (Performance)

What's the best partice for adding a new (calculated) column to a source? Calculate the column in the SQL Query, or add the column later with DAX?

 

Let's say I would like to create a new column, which is basically just a flag. If the status of the order is "COMPLETED", then 1, else 0. Should I modify my query and add the column there, or use DAX for it?

1 REPLY 1
stretcharm
Memorable Member
Memorable Member

I've you've got large datasets then it can provide better compression if it's a SQL column/expression over a DAX column.

 

If you can add as a DAX measure then it's not going store any data and calculated when needed.

However measure cannot be used for slicers.

 

There is a 3rd option add the Competed state in M (Query editor).  Not sure if this is better or worse than in SQL.

 

My preference is SQL, M, DAX Measure then DAX calculated column.

 

I also find SQL is easier to manage change than lots of DAX columns.

 

Here is an post on the storage.

https://www.sqlbi.com/articles/storage-differences-between-calculated-columns-and-calculated-tables/

 

And another one which recomends avoiding calculated columns.

https://powerpivotpro.com/2014/10/5-common-mistakes-made-by-self-taught-dax-students/

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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