Forum Discussion
andysross
9 years agoNew Member
Calculate difference between two rows
speed difference 52 0 63 11 76 13 61 5 How do I create a difference column in power bi like the simple calcula...
- 9 years ago
Yes, measures are often the best solution, but there is a way to do it as a column as well: http://excel-inside.pro/blog/2015/11/05/absolute-and-relative-references-in-power-query/
edgarjb-68
6 years agoFrequent Visitor
I have a question on Power BI. How to calculate rows difference on a table? I want to create a colum "started" as below, for each row of this colums I need to calculate like this excel like formula on cell C2 : =IF(AND(A3=A2;B3-B2<1);"No";"Yes") A B C 1 Part Date Started 2 P01 26/03/2019 05:17 yes 3 P01 07/04/2019 18:56 no 4 P01 07/04/2019 19:56 yes 5 P02 26/03/2019 05:17 yes 6 P02 07/04/2019 18:56 no 7 P02 07/04/2019 19:56 yes
- ImkeF6 years agoCommunity Champion
Hi edgarjb-68 ,
please check this method on how to reference a different row in PQ: https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-power-query-or-power-bi/