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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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] 

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] 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.