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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I would like to create a new column which would measure the difference between the two rows to find the "scan length"
What would be the DAX formula for this?
Thanks!
new column=maxx(filter(table,table[Local Time]>earlier(table[Local Time])),table[Local Time])-table[Local Time]
Hi @Anonymous
Try this:
Diff =
var _curMeasure = MAX(myTable[Measure]) //This row's measure
var _curTime = MAX(myTable[Time]) //This row's time
var _calc = CALCULATE(MAX(myTable[Measure]),FILTER(ALL(myTable),myTable[Time]<_curTime)) //Get the measure of the previous row
return IF(_curMeasure-_calc=_curMeasure,0,_curMeasure-_calc) //if there is no previous measure, then 0 else the diff
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
I am unsure what to put for this rows measure?
Thanks
Hi @Anonymous ,
As you did not supply us with a pbix, I created a quick table called myTable with the columns named Time and Measure.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
4 | |
3 |