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
andrewb95
Helper II
Helper II

Extraño problema al usar Medidas para Ayer/Hoy

He creado algunas medidas para contar el número de reservas que se realizan a diario. La idea principal es que quiero capturar las reservas de hoy y ayer, entonces contra el propietario que las ha reservado (ver tabla a continuación) cada fila es un miembro del equipo diferente. Me he escondido para el propósito de este hilo.

Mis cálculos:

Today = CALCULATE(COUNT(Data[Status]),Data[Date was booked]>=TODAY())

Backend-Yesterday = CALCULATE(COUNT(Data[Status]),DATESINPERIOD(Data[Date was booked],LASTDATE(Data[Date was booked]),-2,DAY))

Yesterday = [Backend-Yesterday] - [Today] 

Esto proporciona los siguientes registros:

Powerbi_upload_question.PNG

La única diferencia en las tablas es la primera tabla que excluyo la fila cuando el propietario es 'NA' ya que aún no se ha atribuido correctamente. Sin embargo, verá los siguientes elementos:

  • Tabla 1 - La figura total es correcta PERO si cuenta manualmente los registros que muestran allí el total no tiene sentido
  • Tabla 1 - Fila 2 (7,7,en blanco) este valor debe ser 100% 0.
  • La única diferencia entre las dos tablas es la fila 2 de la fila 5 (1,0,1) ya que incluyo 'NA' todavía, ya que esto tira cada total completamente apagado.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@andrewb95 , por qué > por hoy

Inténtalo como

Today = CALCULATE(COUNT(Data[Status]),Data[Date was booked]=TODAY())

Backend-Yesterday = CALCULATE(COUNT(Data[Status]),Data[Date was booked]=TODAY()-1)

Yesterday = [Backend-Yesterday] - [Today] 
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@andrewb95 , por qué > por hoy

Inténtalo como

Today = CALCULATE(COUNT(Data[Status]),Data[Date was booked]=TODAY())

Backend-Yesterday = CALCULATE(COUNT(Data[Status]),Data[Date was booked]=TODAY()-1)

Yesterday = [Backend-Yesterday] - [Today] 
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Kudoed Authors