Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AriFin
Regular Visitor

How to calculate relative references when need to refer previous value in same column

How to calculate relative references in power query?

how I could calculate "sum" and "total" columns in power query when I need to refer previous value in same column?

in excel it is easy:

- sum column is =IF(B3=0,0,B3+C2) 

- total column is =IF(C4<C3,C3,0)

 

datetimeamountsumtotal
    
1.6.2018100100.000
2.6.2018100200.000
1.6.2019100300.00300
2.6.201900.000
1.6.2020100100.000
2.6.2020100200.00200
1.6.202100.000
2.6.2021100100.000
1.6.2022100200.00200
1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

Given the first 2 columns as input, the SUM column can be obtained with a measure directly in your visual (using DAX instead of Power Query).  Will that work for you?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.