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
alexei7
Continued Contributor
Continued Contributor

Medir para seleccionar el valor más reciente de una dimensión, en función de la fecha filtrada

Estoy luchando para llegar con el DAX para el producto una medida que me dará el estado "más reciente" para un producto.
El informe contiene una segmentación de fecha, por lo que la "fecha más reciente" para el estado dependería del intervalo de fechas en el que el usuario había filtrado.

Mis datos de origen son una tabla grande que contiene los siguientes campos:

Productid
Productname
Ubicación
Fecha
Estado
ProductCategory
ProductAbbreviation
Muchas otras dimensiones que deben ser ignoradas para este informe...

Mi salida deseada es una tabla con lo siguiente:

Productid
Productname
Ubicación
Estado más reciente - nueva medida

Notas

- Los datos se añaden/actualizan mensualmente
- Los productos pueden estar en más de un lugar
- Los usuarios podrán filtrar en la fecha

El modelo pbix con algunos datos falsos en él está aquí:

https://mega.nz/file/ao1n3STS#uDqZD0TH-cG5-8_YlWu5PZSS0k6PVaaikXUtb4KSJxg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@alexei7 , Añadir este

lastnonblankvalue(Table[Date], max(Table[Status]))

O


calculate(max(Table[Status]), filter(Table, Table[Date] á calculate(max(Table[Date]), allexcept(Table, Table[Product ID]))

O

calculate(max(Table[Status]), filter(Table, Table[Date] á calculate(max(Table[Date]), allexcept(Table, Table[Product ID], Table[Location]))))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@alexei7 , Añadir este

lastnonblankvalue(Table[Date], max(Table[Status]))

O


calculate(max(Table[Status]), filter(Table, Table[Date] á calculate(max(Table[Date]), allexcept(Table, Table[Product ID]))

O

calculate(max(Table[Status]), filter(Table, Table[Date] á calculate(max(Table[Date]), allexcept(Table, Table[Product ID], Table[Location]))))

alexei7
Continued Contributor
Continued Contributor

Gracias por su ayuda - funcionó perfectamente.

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.