Measure vs Calculated Column for DATEDIFF Calculation

I have a question about calculating the days between two dates. I have a table with a column for the record create date and I need to calculate the # of days this record has been in the table through today. My question is, should I add a column and use DATEDIFF or should I use DATEDIFF in an iterating measure? Or does it matter? I am really just trying to understand the best practice. This is a fairly small model so I don’t think it will really affect performance but maybe it will on a bigger model?

Thanks!

I think if you are looking for the best place, if you have these dates in Power Query, could you calculate there so it can compress if possible. If not, is there a reason this just can’t be a regular measure?

I believe there is topics on this subject within the forum that has been solved…

Hello @patrickcox I suggest using the forum search to discover if your query has been asked before by another member.

You may want to check out the threads below as well:

Thanks for sharing these and I actually saw both of those posts but I don’t believe they really answer my specific question. My question was regarding the best practice in terms of calculated column vs a measure for time intelligence calculations. I ended up using a measure. Thanks.

Hello @patrickcox … Sorry if I am late on this.
My understanding is that unless you plan to use “no. of days” on a slicer, you can very well use measures. I mean measure is the best practice if you do not intend to slice your visulizations by the “no. of days”.

Reference:

Power BI Calculated Column vs Measure: A Comparison

Measures vs. calculated columns in DAX and Power BI

1 Like

Thank you! This was very helpful!

1 Like