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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.