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
Anonymous
Not applicable

Count values in consecutive months until a certain date is met

In Power BI desktop, how to count the rows or values from the start date up to the filled date?

For example, my data is like this:

nicomathers_0-1686087803375.png

I want to create a column chart that would show the count of all open req numbers from Open Date up to the Fill date. So for the table above, the req number should show 1 from 12/1/2021 up to 6/10/2022 and when I select the months beyond the fill date, the number should be 0 since the fill date was met already like the chart below.

nicomathers_1-1686088016895.png

 

I don't have any code or dax formula to share right now cause I haven't done anything yet and I honestly don't know how to start.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Anonymous 
You have to create a disconnected date table and measure like :

NEW Recks = calculate(
                                           count(table[req_number]),
                                           Filter (
                                           table,
                                          table[open_Date] <= calculate(max(datetable1[date]) ) &&
                                          table[fill_Date] >= calculate(min(DateTable1[Date]))))
please see a linked discussion for more details:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @Anonymous 
You have to create a disconnected date table and measure like :

NEW Recks = calculate(
                                           count(table[req_number]),
                                           Filter (
                                           table,
                                          table[open_Date] <= calculate(max(datetable1[date]) ) &&
                                          table[fill_Date] >= calculate(min(DateTable1[Date]))))
please see a linked discussion for more details:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

This is perfect! Thank you so much for your help.

I'm happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.