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, im trying to do something like this
When id matchs, it calculates the time difference with the previous record
I think in something with earlier function and filter but i couldnt make it work
Any ideas?
Thanks!
Solved! Go to Solution.
EARLIER refers to the filter context, not to the date/position in table
try this
Column = VAR _id = 'Table'[id] VAR _created = 'Table'[created] VAR _previousDate = CALCULATE(MAX('Table'[created]),FILTER(ALL('Table'),'Table'[id] = _id && 'Table'[created] < _created)) VAR _handleBlanks = IF(ISBLANK(_previousDate),_created,_previousDate) RETURN _created-_handleBlanks
EARLIER refers to the filter context, not to the date/position in table
try this
Column = VAR _id = 'Table'[id] VAR _created = 'Table'[created] VAR _previousDate = CALCULATE(MAX('Table'[created]),FILTER(ALL('Table'),'Table'[id] = _id && 'Table'[created] < _created)) VAR _handleBlanks = IF(ISBLANK(_previousDate),_created,_previousDate) RETURN _created-_handleBlanks
Thanks for the help!
It is working
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 |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |