Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a couple of date comparison calculations I need to perform in Power BI. Both are very straight forward, but I was wondering what the most efficient way would be to do them.
I need a new column in two different tables, which provides a number of months between two dates. I require the column so that I can use it as a row/axis input into visuals in my report.
In one instance, both the date columns are contained within one table. In the other instance, the date columns are in different tables but can be easily accessed through the RELATED function.
There are around 80,000 rows in each table I need these columns. In each of these instances, would you use a DATEDIFF function, or would you complete the steps in Power Query instead (including the merge in the second instance)?
My data model is not overly large (around 85mb) but my refresh times are beginning to get a bit long (not related to these two tables though), so I am hoping to avoid as many expensive Power Query steps as possible! The new columns will have very low cardinality (a numeric number between -1 and 12) so data model size is not too much of a concern.
Solved! Go to Solution.
Hi @possible-possum ,
In general, choosing between calculated columns in DAX and calculated columns in Power Query depends on a number of factors, and here are some considerations for both approaches:
In your scenario, using calculated columns in DAX is straightforward if the dates are in the same table or if associations can be easily established. You can evaluate the performance impact and adjust your approach based on test results.
For more details, you can read below blog:
Comparing DAX calculated columns with Power Query computed columns - SQLBI
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @possible-possum ,
In general, choosing between calculated columns in DAX and calculated columns in Power Query depends on a number of factors, and here are some considerations for both approaches:
In your scenario, using calculated columns in DAX is straightforward if the dates are in the same table or if associations can be easily established. You can evaluate the performance impact and adjust your approach based on test results.
For more details, you can read below blog:
Comparing DAX calculated columns with Power Query computed columns - SQLBI
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
9 | |
8 |