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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
brouwno
New Member

Calculate how many items are between two dates

Hi community,

 

Hope someone can help me with this. I cannot seem to get the right formula.

 

I have two tables:

 

- 1st tabel contains a column with a datetime (creationDate) and a column with a locationname (name)

- 2nd table contains two columns with a date time (startDate & endDate) and a column with a locationname (name)

 

I want to create a matrix where I show:

- Rows: Locations (from table 1)

- Columns: Month (the matrix is filtered by year, i.e. 2020)

- Values: Here I want to show how many rows from the 2nd table, from which the startDate & endDate are in that month of the Matrix.

 

For example if a record in table 2 had a startDate of 02-11-2019 and an endDate of 15-02-2020, it had to be counted in the maxtrix value for januari and febrari of 2020, but not for march 2020.

 

I hope I explained correctly, if not: Let me know!

 

I appreciate all the help you can give me.

1 ACCEPTED SOLUTION
reynaldo_malave
Helper III
Helper III

HI @brouwno,

This looks like an event in progess problem (not really sure). Take a look  at this aritcle https://www.daxpatterns.com/events-in-progress/ Hope it helps.

 

Reynaldo

View solution in original post

2 REPLIES 2
reynaldo_malave
Helper III
Helper III

HI @brouwno,

This looks like an event in progess problem (not really sure). Take a look  at this aritcle https://www.daxpatterns.com/events-in-progress/ Hope it helps.

 

Reynaldo

Thanks for taking the time to give me an reply @reynaldo_malave!!

 

The link you provided showed a more elegant solution than I had come up with 🙂

 

It alo turned out that my data sources do not always have alle the information I expected. Therefore the results of my measures were not what I expected. At first I thought my measures were not correct, but it turned out the be a little of both 😅

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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