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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power BI Optimization

There is a lot of documentation about when to use DAX Measures vs DAX calculated columns. However, in what instances would it make sense to create a calculated column in the source i.e. SQL vs creating a DAX Measure?

1 ACCEPTED SOLUTION
Applicable88
Impactful Individual
Impactful Individual

@Anonymous,   measures are computed at runtime and calculated columns needs to be stored. That means measures does not need storage space, but the latter do. They also tend to make your calculation slower, since your model grow with the columns generated. Thats the reason when possible to use measures. They are only computed when you need them. Anyway, a good reason for the need of a calculated column might be the need for a "customize" dimension that you need for a bar chart. For example your mastercalendar doesn't consist of a weeknumber to the date, than you need to create one with weeknumber() - function. And now go further that you want to to have a bar chart dimension, where your calendar week is concatenated with the year number together á la " 2021 / 40 " . If you want a customized dimension you need a calculated column for that. You cannot drag a measure into a bar chart visual as a dimension. 

I hope that helps. 

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Measures are displayed based on dynamic aggregation results, which take up more CPU, while calculated columns are displayed based on static results, which take up more memory.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Applicable88
Impactful Individual
Impactful Individual

@Anonymous,   measures are computed at runtime and calculated columns needs to be stored. That means measures does not need storage space, but the latter do. They also tend to make your calculation slower, since your model grow with the columns generated. Thats the reason when possible to use measures. They are only computed when you need them. Anyway, a good reason for the need of a calculated column might be the need for a "customize" dimension that you need for a bar chart. For example your mastercalendar doesn't consist of a weeknumber to the date, than you need to create one with weeknumber() - function. And now go further that you want to to have a bar chart dimension, where your calendar week is concatenated with the year number together á la " 2021 / 40 " . If you want a customized dimension you need a calculated column for that. You cannot drag a measure into a bar chart visual as a dimension. 

I hope that helps. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.