cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Resolver II

Recuento del número de datos hasta la fecha de hoy en PowerBI

Quiero contar el número de facturas de compra que han sido vencidas hasta la fecha de HOY. Para ello, tengo un campo que me informa de cuando vence una factura: due_date_id.

He probado con esto, sin embargo, creo que la fórmula no es correcta:

``````num_facturas_vencidas =
CALCULATE(
COUNT(fact_purchase_invoice[purchase_invoice_id]),
fact_purchase_invoice[due_date_id]<TODAY()
)``````

Muchas gracias!

1 ACCEPTED SOLUTION
Super User

@powerbi2srm , This should work if due_date_id is a date

num_facturas_vencidas =
CALCULATE(
COUNT(fact_purchase_invoice[purchase_invoice_id]),Filter(fact_purchase_invoice, fact_purchase_invoice[due_date_id]<TODAY() )
)

or try like

num_facturas_vencidas =
CALCULATE(
COUNT(fact_purchase_invoice[purchase_invoice_id]),Filter(fact_purchase_invoice, fact_purchase_invoice[due_date_id]< (format(TODAY(), "YYYYMMDD") *1)  )
)

Super User

@powerbi2srm , This should work if due_date_id is a date

num_facturas_vencidas =
CALCULATE(
COUNT(fact_purchase_invoice[purchase_invoice_id]),Filter(fact_purchase_invoice, fact_purchase_invoice[due_date_id]<TODAY() )
)

or try like

num_facturas_vencidas =
CALCULATE(
COUNT(fact_purchase_invoice[purchase_invoice_id]),Filter(fact_purchase_invoice, fact_purchase_invoice[due_date_id]< (format(TODAY(), "YYYYMMDD") *1)  )
)