Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |