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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

numero de días entre entre fechas

Hola,

 

Necesito obtener el numero de dias entre fechas que no son seguidas. por ejemplo lo que muestra una imagen necesito una medida que me indique cuantos dias hay de una a otra por ejemplo entre 2020-03-09 cuantos dias hay con base en 2020-03-05 y tambien seria entre 2020-03-05 cuantos dias hay con base en 2020-03-01.

Capture.PNG

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You could also use this logic to create the measure as below:

Measure = DATEDIFF(CALCULATE(MAX('Table'[Fecha]),FILTER(ALL('Table'),'Table'[Fecha]<MAX('Table'[Fecha]))),CALCULATE(MAX('Table'[Fecha])),DAY)

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Not very clear from you example. But in case you need date diff from last date you can  have a new column like

Date diff = datediff( maxx(filter(table,[Date]<earlier([Date]) ),[Date]),[Date],DAY)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hola  

 

gracias por tu respuesta, pero lo que necesito es una medida para mostrarla en una matrix, lo que se quiere es cada vez que se filtren fechas la medida haga la diferencia entre las fechas.

 

Por ejemplo si en la matrix estan en las filas las fechas 2020-02-05 , 2020-02-10, 2020-02-15 

lo que debe hacer la medida es decir cuantos dias en la fila de 2020-02-15 de mostrar los dias entre 2020-02-15 y 2020-02-10
en la fila de 2020-02-10 debe msotrar en numero de dias entre 2020-02-10 y 2020-02-07 y la ultima como no tiene comtra que comparar debe colocarle 1.

 

FechaDias
7/02/20201
10/02/20203
15/02/20205

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.