March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |