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.
Hello I want to calculate the acumulated production per year, task and ID, like in the following table, can you help me?
ID | TASK | YEAR | PRODUCTION | Accumulated production |
0 | 1 | 1 | -80 | -80 |
0 | 1 | 2 | 100 | 20 |
0 | 1 | 3 | 110 | 130 |
0 | 1 | 4 | 105 | 235 |
1 | 2 | 1 | -50 | -50 |
1 | 2 | 2 | -60 | -110 |
1 | 2 | 3 | -80 | -190 |
1 | 2 | 4 | 100 | -90 |
1 | 2 | 5 | 200 | 110 |
1 | 2 | 6 | 300 | 410 |
2 | 3 | 1 | -89 | -89 |
2 | 3 | 2 | -74 | -163 |
2 | 3 | 3 | -50 | -213 |
2 | 3 | 4 | -20 | -233 |
2 | 3 | 5 | 500 | 267 |
Hi @OscarSuarez10 ,
try the following expression:
Hello @Anonymous I applied the formula in this way:
ACUMULATED PRODUCTION =
var var_year = SELECTEDVALUE('pruebas'[YEAR])
return
CALCULATE(
sum('pruebas'[PRODUCTION]) ;
'pruebas'[YEAR]<= var_year
)
But i got nothin in the column:
Doy you know what am i doing wrong?
Hi @OscarSuarez10 ,
I don't know what could happen. Check out the screenshot I attached, it may helps you:
Hi,
modify below:
Hello @Anonymous , thanks for your help, when I use this formula I get the same values, is not adding the previus one:
YEAR | PRODUCTION | Accumulated production |
1 | -80 | -80 |
2 | 100 | 100 |
3 | 110 | 110 |
4 | 105 | 105 |
1 | -50 | -50 |
2 | -60 | -60 |
3 | -80 | -80 |
4 | 100 | 100 |
5 | 200 | 200 |
6 | 300 | 300 |
1 | -89 | -89 |
2 | -74 | -74 |
3 | -50 | -50 |
4 | -20 | -20 |
5 | 500 | 500 |
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |