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

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

Reply
powerbi2srm
Resolver II
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
amitchandak
Super User
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)  )
)

View solution in original post

1 REPLY 1
amitchandak
Super User
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)  )
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.