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
CLEARIFY
Helper I
Helper I

Fecha MAX dentro de una columna de fechas (en una tabla FACT) que es menor o igual que la actual

Estoy buscando un cálculo simple que encuentre la fecha máxima en un campo de fecha de tabla FACT, que sea menor o igual que la fecha de hoy, y diría algo como esto:

CALCULATE(MAX(Table.Date donde Table.Date es menor que hoy

He intentado muchas opciones, incluyendo filtro, etc. pero no obtener el valor correcto.

Así que, por ejemplo, si tenía una lista de fechas:

1/1/2020

6/3/2020

10/13/2020

12/15/2020

y hoy es 10/14/2020 mi regreso sería 10/13/2020

Estoy usando esto para cargar una sola variable que debe contener la fecha real (por ejemplo, 10/13/2020.

1 ACCEPTED SOLUTION

Prueba esto
CALCULATE(MAX(table[date]),filter(all(table[date]),table[date]<-today()))

Depende si está utilizando una tabla caledndar, y cómo mostrará el resultado, pero espero que ayude.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hola @CLEARIFY ,

¿Está resuelto su problema?

Creo que lo que sugiere @amitchandak puede resolver su problema, hice un archivo pbix para los detalles si es necesario,ver adjunto.

La medida es la siguiente:

Measure = CALCULATE(MAX('Table'[Dates]),FILTER(ALL('Table'),'Table'[Dates]<TODAY()))

Y verás:

Screenshot 2020-10-16 160930.png

Si su problema aún no está resuelto, pls hágamelo saber.

Saludos
Kelly

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

amitchandak
Super User
Super User

@CLEARIFY ,

Inténtalo como

calculate(max(Table[Date]), filter(Table, Table[Date] <Today()))

Prueba esto
CALCULATE(MAX(table[date]),filter(all(table[date]),table[date]<-today()))

Depende si está utilizando una tabla caledndar, y cómo mostrará el resultado, pero espero que ayude.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.