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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Bobmoran
New Member

How to count Line between 2 dates

  • Hi everybody,

I need you help, I would like on power bi count the following.

In a table, an order may be delivered between date 1 and date 2.

I would like to count for each month How many order I may receive.

Example  for order 1, if delivery may occure between march and june, I would like to count 1 in march, 1 in april,…1 in june.

If I have an other order with same delivery window, I would count it also.

Finally I would like to now how many order I may receive in march, in april,….

Any idea? Possible to do it with power bi?

Thank you 

2 REPLIES 2
Anonymous
Not applicable

Hi @Bobmoran ,

From your description, it sounds like you're looking to count orders expected to be delivered within a specific date range and then break down this count by month.

Please try below steps:

 

1. Create a Date Table: If you haven't already, create a Date table that includes all dates that could possibly fall within your order delivery windows. This table should span beyond your current order dates to accommodate future orders. Make sure this table is marked as a Date table in Power BI.

 

2. Establish Relationships: Ensure there's a relationship between your Date table and your Orders table. Typically, this would be a relationship between the Date column in your Date table and the delivery date columns in your Orders table.

 

3. Create a Measure: You'll need to create a DAX measure to count the orders expected to be delivered each month. Here's an example measure that might work for you:

OrdersCountPerMonth = 
CALCULATE(
    COUNTROWS('Orders'),
    FILTER(
        'Date',
        'Date'[Date] >= MIN('Orders'[StartDate]) && 'Date'[Date] <= MAX('Orders'[EndDate])
    )
)

This measure counts the rows in your Orders table where the date falls between the StartDate and EndDate of the orders.

 

4. Visualize the Data: Use this measure in a visual, such as a bar chart or matrix. Drag the month column from your Date table to the Axis area and the OrdersCountPerMonth measure to the Values area.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

you are using a lot of terms loosely. Please be more precise.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.