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.
Hi,
the are already a lot of topics based on cumulative in power bi but I coudn't figure it out so far.
What I have:
Date | productID | value |
01.01.2022 | 1270 | 30000 |
01.01.2022 | 1280 | 200000 |
02.01.2022 | 1280 | -50 |
01.02.2022 | 1280 | 100 |
01.02.2022 | 1280 | 200 |
01.02.2022 | 1270 | -20 |
01.03.2022 | 1270 | 80 |
29.12.2022 | 1270 | 100 |
29.12.2022 | 1280 | 10 |
31.12.2022 | 1270 | 35 |
31.12.2022 | 1270 | 5 |
01.01.2023 | 1270 | 50000 |
01.01.2023 | 1280 | 100000 |
04.01.2023 | 1270 | 50 |
06.01.2023 | 1280 | -100 |
Value should be calculated cumulative per day with a fresh start from each year and per productID.
What I want as a measure is Cumulative Per Year.
Date | productID | value | Cumulative per Year |
01.01.2022 | 1270 | 30000 | 30000 |
01.01.2022 | 1280 | 200000 | 200000 |
02.01.2022 | 1280 | -50 | 199950 |
01.02.2022 | 1280 | 100 | 200050 |
01.02.2022 | 1280 | 200 | 200250 |
01.02.2022 | 1270 | -20 | 29980 |
01.03.2022 | 1270 | 80 | 30060 |
29.12.2022 | 1270 | 100 | 30160 |
29.12.2022 | 1280 | 10 | 200260 |
31.12.2022 | 1270 | 35 | 30195 |
31.12.2022 | 1270 | 5 | 30200 |
01.01.2023 | 1270 | 50000 | 50000 |
01.01.2023 | 1280 | 100000 | 100000 |
04.01.2023 | 1270 | 50 | 50050 |
06.01.2023 | 1280 | -100 | 99900 |
Thanks for any help.
This post was very close but I coudnt use the answer for my needs.
https://community.powerbi.com/t5/Desktop/How-to-calculate-cumulative-values-by-daily/m-p/503511#M235...
Solved! Go to Solution.
Try this measure:
Cumulative per Year =
CALCULATE (
SUM ( Table1[value] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[productID] = MAX ( Table1[productID] )
&& Table1[Date] <= MAX ( Table1[Date] )
&& YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
)
)
Proud to be a Super User!
Try this measure:
Cumulative per Year =
CALCULATE (
SUM ( Table1[value] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[productID] = MAX ( Table1[productID] )
&& Table1[Date] <= MAX ( Table1[Date] )
&& YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
)
)
Proud to be a Super User!
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 |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |