简体   繁体   中英

How to Subtract row by row in Power Bi?

在此处输入图像描述

In this dataset I am trying to develop a column or a measure based upon the hours column. I am trying to determine the difference between the first and second hour rows, the second and third hour rows, etc. and all the way through the entirety of the data.

Note: there are multiple serial numbers in this table; I just used this serial as an example.

I'm not sure this should be tagged with SQL-Server unless you can change the SQL that sources the data. If so you could pre-calculate this inside SQL Server.

If you can change the Power Query that brings the data into the data model you can add an Index column as the data's coming in and use that.

Please see: How to Compare the Current Row to the Previous Row Using DAX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM