Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi colleagues,
I need some help from your side, please.
I'm trying to calculate the diference between the dates marked as blue. I have created a measure that returns the DIFF PRO Date - MIN Slicer, it means the diference between the min date selected in the slicer and de field production date for each item. The result is true but the Total is not right as you can see.
The measure that I've created is :
Solved! Go to Solution.
Your total is incorrect because the SUM function on your measure is summing all production dates, which skews the calculation at the total level.
Why is this occurring?
The SUM(tProcessTab[FechaProduccion]) sums all production dates and produces an unrealistic total date.
The DATEDIFF is computed on this in-correctly aggregated date.
The calculation at the row level is correct but at the Total row, it is incorrect.
How to Fix It?
Replace SUM with SUMX, which performs row by row and provides the proper total:
DAX
DIFF PRO Date - MIN Slicer =
VAR StartDate = SELECTEDVALUE(tProcessTab[FechaProduccion])
VAR EndDate = MIN(CalendarioEjecuciones[Date])
RETURN
IF(NOT ISBLANK(StartDate), DATEDIFF(StartDate, EndDate, DAY))
Your total is incorrect because the SUM function on your measure is summing all production dates, which skews the calculation at the total level.
Why is this occurring?
The SUM(tProcessTab[FechaProduccion]) sums all production dates and produces an unrealistic total date.
The DATEDIFF is computed on this in-correctly aggregated date.
The calculation at the row level is correct but at the Total row, it is incorrect.
How to Fix It?
Replace SUM with SUMX, which performs row by row and provides the proper total:
DAX
DIFF PRO Date - MIN Slicer =
VAR StartDate = SELECTEDVALUE(tProcessTab[FechaProduccion])
VAR EndDate = MIN(CalendarioEjecuciones[Date])
RETURN
IF(NOT ISBLANK(StartDate), DATEDIFF(StartDate, EndDate, DAY))
Thanks a lot, you have helped me a lot.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 21 | |
| 20 | |
| 12 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 42 | |
| 36 | |
| 35 |