cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## 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:

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.

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
Super User

Hi @nicomathers
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]))))
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
3 REPLIES 3
Super User

Hi @nicomathers
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]))))
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
Frequent Visitor

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

Super User

I'm happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors