Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a table visual as shown below where Created_TS is the session start time and Created_TS_End is session end time. I would like to use DATEDIFF function to calculate session gap between previous end time and current start time for each row as shown in 2 red box below after the data is sorted by Created_TS. Is there an easy way to do it?
My data is pretty large one over 710,000 rows. It takes very long time to create the new column (still waiting for it). I believe a measure should have a much better performance as it will be used with a selected case via drill-through. So I tried to define the following measure, but it gives me an error. The root cause should be the 1st row which won't have previous (earlier) value. How to address it?
Thanks.
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.
Please chech the below picture and the attached pbix file.
It is for creating a calculated column.
Expected result CC =
VAR _prevstart =
MAXX (
FILTER ( Data, Data[Created_TS] < EARLIER ( Data[Created_TS] ) ),
Data[Created_TS]
)
VAR _prevend =
MAXX ( FILTER ( Data, Data[Created_TS] = _prevstart ), Data[Created_TS_End] )
VAR _start = Data[Created_TS]
VAR _diffinminutes =
DATEDIFF ( _prevend, _start, MINUTE )
RETURN
_diffinminutes
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 8 | |
| 8 |