Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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?
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/
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 103 | |
| 67 | |
| 65 | |
| 56 |