Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hola, soy usuario principiante y quiero hacer una tabla siguiente con una condicion de gastos:
Tabla actual "Dades2024"
| Id de usuario | Enero | Febrero | Marzo |
| 234234 | 30 | 30 | 0 |
| 43545 | 40 | 5 | 3 |
| 234324 | 15 | 30 | 0 |
la nueva tabla "Gastos2024"
| Id de usuario | Enero | Febrero | Marzo | acumulado año | Forfait | Saldo |
| 234234 | 30 | 30 | 0 | 60 | 50 | 0 |
| 43545 | 40 | 5 | 3 | 48 | 50 | 2 |
| 234324 | 15 | 30 | 0 | 45 | 50 | 5 |
La idea es crear una tabla que me calcule el coste acumulativo de cada mes, pero si en el mes de marzo ha superado 50€ debera crear una "alarma" para pagar al Usuario 50€ y el resto de año no se le pagara nada mas.
Código:
Resumen =
VAR Tabla = SUMMARIZE(
dades2024,
dades2024[ID de usuario],
dades2024[Mes],
"Gasto mensual", SUM(dades2024[Preu (fins 14 min)])
)
VAR Acumulado =
ADDCOLUMNS(
Tabla,
"Acumulado",
CALCULATE(
SUMX(
FILTER(
Tabla,
dades2024[Mes] <= EARLIER(dades2024[Mes])
),
dades2024[Preu (fins 14 min)]
)
)
)
RETURN
ADDCOLUMNS(
Tabla,
"Gasto mensual acumulado", [Acumulado],
"Supera 80€", IF([Acumulado] >= 80, 1, 0)
)
Necesito una ayuda.
Gracias
Solved! Go to Solution.
Hi @jimmy69
You can use the following measure to get the cumulative amount for the previous three months.
Accumulate = SELECTEDVALUE('Table 2'[Jan])+SELECTEDVALUE('Table 2'[Feb])+SELECTEDVALUE('Table 2'[Mar])
You can use the following measure to get the amount you get.
Measure = IF('Table 2'[Accumulate]>50,0,50-'Table 2'[Accumulate])
This is the result you want.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jimmy69
You can use the following measure to get the cumulative amount for the previous three months.
Accumulate = SELECTEDVALUE('Table 2'[Jan])+SELECTEDVALUE('Table 2'[Feb])+SELECTEDVALUE('Table 2'[Mar])
You can use the following measure to get the amount you get.
Measure = IF('Table 2'[Accumulate]>50,0,50-'Table 2'[Accumulate])
This is the result you want.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 56 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 26 |