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
Hi all,
I'm trying to calculate the difference between two date columns, however I'm running into some difficulty. The two columns, startdate and enddate, are coming from a Dim table, so if I try to create a measure using DATEDIFF it won't allow me to select from them, it will only allow me to select from other measures created. Is there a way around this?
I am unable to create a new calculated column as this data is coming straight from SSAS.
Thanks,
Aaron
Solved! Go to Solution.
Hi @Anonymous ,
Based on your description, I have created a simple sample:
Please try:
Diff = DATEDIFF(MAX('Dim'[startdate]),MAX('Dim'[enddate]),DAY)Output:
Kind Regards,
Bubble
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Based on your description, I have created a simple sample:
Please try:
Diff = DATEDIFF(MAX('Dim'[startdate]),MAX('Dim'[enddate]),DAY)Output:
Kind Regards,
Bubble
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This worked! Thank you Bubble, much appreciated
@Anonymous Try something like MyDiff Measure = MAX('Table1'[EndDate]) - MAX('Table1'[StartDate]) * 1.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 30 | |
| 27 | |
| 17 | |
| 11 | |
| 10 |