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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
So I have a table with two columns: invention and year of its creation. I need a measure, which subtracts the minimum date from each date. If I'd create a new column named Diff, it would be Datediff = [disc_year] - MIN(table[disc_year]). But what if I don't want to create it and have a measure calculating in the same manner instead? Any tips?
Solved! Go to Solution.
Hi @nvbuddy
Try this:
Datediff =
Var _Min =calculate(Min(table[disc_year]),all(table))
Var _Mdate = Max(table[disc_year])
Return
_Mdate-_Min
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @nvbuddy
Try this:
Datediff =
Var _Min =calculate(Min(table[disc_year]),all(table))
Var _Mdate = Max(table[disc_year])
Return
_Mdate-_Min
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
It works perfectly, thanks! If you don't mind, could you please clarify logic by steps? Why do we use max? And why we should use calculate with MIN, and not only MIN? I've searched for something like an iteration of subtraction for every row, but the logic in DAX differs from pandas in Python or sql (at least in code). Kinda new at Power BI😥
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
12 | |
11 | |
10 | |
9 |