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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello. I have a problem, I want to calcute time diff in a column. And then I want to filter everything over 20 sec.
Solved! Go to Solution.
Hi @Bergh
Do you want to calculate the difference between current row with the next row? All rows are above 20 sec...or you want something different?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrTUNzDWNzIwMlQwtLAyNFeK1UEVNLcyMcUQNMMuaGSCIWhqZWqpFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetime}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each [nextrow = try #"Added Index"{[Index]+1}[Column1] otherwise [Column1],
comp = ([Column1]-nextrow)> #duration(0,0,0,20)][comp])
in
#"Added Custom"
Hi @Bergh
Do you want to calculate the difference between current row with the next row? All rows are above 20 sec...or you want something different?
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrTUNzDWNzIwMlQwtLAyNFeK1UEVNLcyMcUQNMMuaGSCIWhqZWqpFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetime}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each [nextrow = try #"Added Index"{[Index]+1}[Column1] otherwise [Column1],
comp = ([Column1]-nextrow)> #duration(0,0,0,20)][comp])
in
#"Added Custom"
Thanks Vera_33 it works fine for me!!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.