Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |