This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
How do I work out the difference between rows?
I have the below dataset but would like to create the column "Power Used" this would show me as below;
| Date | Name | Power | Power Used |
| 03/05/2021 12:38 | Projector1 | 963420 | 4 |
| 03/05/2021 12:54 | Projector1 | 963424 | 4 |
| 03/05/2021 13:10 | Projector1 | 963428 | 3 |
| 03/05/2021 13:26 | Projector1 | 963431 | 4 |
| 03/05/2021 13:42 | Projector1 | 963435 | 4 |
| 03/05/2021 13:58 | Projector1 | 963439 | 4 |
| 05/05/2021 04:12 | Computer | 3000869 | 17 |
| 05/05/2021 04:28 | Computer | 3000886 | 17 |
| 05/05/2021 04:44 | Computer | 3000903 | 18 |
| 05/05/2021 05:00 | Computer | 3000921 | 19 |
| 05/05/2021 05:16 | Computer | 3000940 | 17 |
| 05/05/2021 03:24 | Light | 7580555 | 21 |
| 05/05/2021 03:40 | Light | 7580576 | 25 |
| 05/05/2021 03:56 | Light | 7580601 | 23 |
| 05/05/2021 04:12 | Light | 7580624 | 23 |
| 05/05/2021 04:28 | Light | 7580647 | 23 |
| 05/05/2021 04:44 | Light | 7580670 | 21 |
Is there a way to do this in the M Code?
Thanks
Solved! Go to Solution.
Hi, @MrGriff
Please check the below picture and the formula for creating a new column.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, @MrGriff
Please check the below picture and the formula for creating a new column.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Sorry to re-open this again but I have seen that the calculation is wrong, If the current and next power are the calculation just looks a the next value that is higher in value... but really I if the value is the same the result should be 0..
If you can help that would be great
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 31 | |
| 24 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 50 | |
| 33 | |
| 24 | |
| 24 |