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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
DerekC
Frequent Visitor

Using Date Table to compare multiple dates and Sum values

I am using a date table and want to create a measure that shows shipments that were Enroute given a specific time period that is filtered.  If the ship date is greater than the MIN filtered date at the top and the Cust Del date is Greater than the MAX filtered date at the top then I am considering that Enroute and want to sum the Tonnage (yellow highlighted below).  Any help is greatly appreciated! 

DerekC_0-1659121919860.png

 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

I am using a date table and want to create a measure that shows shipments that were Enroute given a specific time period that is filtered.  If the ship date is greater than the MIN filtered date at the top and the Cust Del date is Greater than the MAX filtered date at the top then I am considering that Enroute and want to sum the Tonnage (yellow highlighted below).  Any help is greatly appreciated! 

 

speedramps_0-1659182528528.png

 

Convert the arrival and delivery time to date type file because you dont need the time.

This will save save, run faste and make things less complicated.

 

Create a calendar table and use the calendar table date in the slicer.

Dont user the delivery table in your calandar table.

And dont have a relationship bewteen the calanedar and your delivery table.
Click here to lean about calendar tables 

Now create this meaure your own table and field names ....

 

Enroute Tonnage =
VAR mindate = MIN(Calander[date])
VAR maxdate = MIN(Calander[date])

VAR EnrouteDeliveries = FILTER(Delivery, Delivery[shipdate] > mindate && Delivery[deliverdate] > maxdate )
RETURN
CALCULATE(
SUM(Delivery[tonnage]),
EnrouteDeliveries)

 

How it work ....

The filter command creates a temporary table of enroute deliveries.
The calculate command then just sums tonnage for the enroute deliveries.

Warming!

Consider carefully if you should be using > or >= to select the correct date ranges

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

 

 

 

View solution in original post

1 REPLY 1
speedramps
Super User
Super User

I am using a date table and want to create a measure that shows shipments that were Enroute given a specific time period that is filtered.  If the ship date is greater than the MIN filtered date at the top and the Cust Del date is Greater than the MAX filtered date at the top then I am considering that Enroute and want to sum the Tonnage (yellow highlighted below).  Any help is greatly appreciated! 

 

speedramps_0-1659182528528.png

 

Convert the arrival and delivery time to date type file because you dont need the time.

This will save save, run faste and make things less complicated.

 

Create a calendar table and use the calendar table date in the slicer.

Dont user the delivery table in your calandar table.

And dont have a relationship bewteen the calanedar and your delivery table.
Click here to lean about calendar tables 

Now create this meaure your own table and field names ....

 

Enroute Tonnage =
VAR mindate = MIN(Calander[date])
VAR maxdate = MIN(Calander[date])

VAR EnrouteDeliveries = FILTER(Delivery, Delivery[shipdate] > mindate && Delivery[deliverdate] > maxdate )
RETURN
CALCULATE(
SUM(Delivery[tonnage]),
EnrouteDeliveries)

 

How it work ....

The filter command creates a temporary table of enroute deliveries.
The calculate command then just sums tonnage for the enroute deliveries.

Warming!

Consider carefully if you should be using > or >= to select the correct date ranges

 

Thanks for reaching out for help.

I put in a lot of effort to help you, now please quickly help me by giving kudos.

Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button. 

If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime.  I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me. 

 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you ! 

 

 

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors