Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
jimmy69
Frequent Visitor

Nueva tabla resumen a partir de otra

Hola, soy usuario principiante y quiero hacer una tabla siguiente con una condicion de gastos:

Tabla actual "Dades2024"

Id de usuarioEneroFebreroMarzo
23423430300
435454053
23432415300

 

la nueva tabla "Gastos2024"

Id de usuarioEneroFebreroMarzoacumulado añoForfaitSaldo
2342343030060500
43545405348502
2343241530045505

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

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vjialongymsft_0-1710381552818.png

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

vjialongymsft_0-1710381552818.png

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.