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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I'm trying to make a dax formula to calculate the date difference between the date on the column and the max(date) column in another table.
DIM_Kalender: Base table which is filtered by using a slicer
Dim_Kalender (2): I want a dynamic datediff() calculation between the row date value and the selected slicer value that filters table DIM_Kalender.
By using the formula below he however doesn't compare the max() value from the other table, but the max value in the current table. By adding the var value in a seperate calculated measure the correct max() value appears.
What is wrong in my DAX calculation?
FlagLast7Days_2 =
var LastFoundDateDataSet_2 = CALCULATE( MAX ( DIM_Kalender[Datum] ); ALLSELECTED ( DIM_Kalender ) )
var Datum = 'DIM_Kalender (2)'[Datum]
return
DATEDIFF( LastFoundDateDataSet_2 ; Datum ; DAY )
Screenshot on the following links:
Best regards,
M
Make sure it is a measure, not calculated column.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 51 | |
| 39 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 84 | |
| 33 | |
| 29 | |
| 25 |