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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I need a Calculated column for Date difference of same date based on different stages and ID.The stage will start at any level, for initial stage date difference should be 0 for each ID. The Final column value should as in Date Difference
Solved! Go to Solution.
@Anonymous Please try this as a "New Column"
DateDiff = VAR _PrevDate = LOOKUPVALUE(Test48CummDateDiff[Date],Test48CummDateDiff[ID],Test48CummDateDiff[ID],Test48CummDateDiff[Stage],Test48CummDateDiff[Stage]-1) VAR _PrevDateClean = IF(_PrevDate=BLANK(),Test48CummDateDiff[Date],_PrevDate) RETURN DATEDIFF(_PrevDateClean,Test48CummDateDiff[Date],DAY)
Proud to be a PBI Community Champion
@Anonymous 🙂 It's working fine, As per the screenshot - Your data contains 23-Aug-2017 for Stage 3, ID 421 (Row 3) that's why you are seeing huge date difference. But where as your initial sample data contains 23-Aug-2018.
Proud to be a PBI Community Champion
@Anonymous Please try this as a "New Column"
DateDiff = VAR _PrevDate = LOOKUPVALUE(Test48CummDateDiff[Date],Test48CummDateDiff[ID],Test48CummDateDiff[ID],Test48CummDateDiff[Stage],Test48CummDateDiff[Stage]-1) VAR _PrevDateClean = IF(_PrevDate=BLANK(),Test48CummDateDiff[Date],_PrevDate) RETURN DATEDIFF(_PrevDateClean,Test48CummDateDiff[Date],DAY)
Proud to be a PBI Community Champion
@PattemManohar Thanks for the effort. But as output am getting different values as below. I need a date difference of previous stages for each ID
@Anonymous 🙂 It's working fine, As per the screenshot - Your data contains 23-Aug-2017 for Stage 3, ID 421 (Row 3) that's why you are seeing huge date difference. But where as your initial sample data contains 23-Aug-2018.
Proud to be a PBI Community Champion
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 82 | |
| 72 | |
| 46 | |
| 35 |