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.
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)
datetime | amount | sum | total |
1.6.2018 | 100 | 100.00 | 0 |
2.6.2018 | 100 | 200.00 | 0 |
1.6.2019 | 100 | 300.00 | 300 |
2.6.2019 | 0 | 0.00 | 0 |
1.6.2020 | 100 | 100.00 | 0 |
2.6.2020 | 100 | 200.00 | 200 |
1.6.2021 | 0 | 0.00 | 0 |
2.6.2021 | 100 | 100.00 | 0 |
1.6.2022 | 100 | 200.00 | 200 |
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
96 | |
79 | |
66 | |
62 |
User | Count |
---|---|
145 | |
113 | |
105 | |
85 | |
65 |