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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CoordAnalytics
Frequent Visitor

Sum of Value between 2 Dates

I've got two tables, Order and Calendar. I need to figure out how many business days between order sequence 1 and order sequence 2 for each order in the order table. There's a relationship between the two on change_date to cal_date and both are connected to a customer table based on customer ID. I was thinking there must be a way to write a dax measure to sum the membership_value between the date for sequence 1 and the date for sequence 2, but I can't figure out how to do that specifically for each order number. And each customer has their own calendars and they can vary by year. Any help would be appreciated. 

Order Table

CoordAnalytics_0-1666963826669.png

Calendar Table

CoordAnalytics_1-1666963871040.png

 

 

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @CoordAnalytics ,

see my new pbi file. I hope now it is good.

https://1drv.ms/u/s!Aj45jbu0mDVJizDXMvR1_j8dnilA?e=x55QRg

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
mangaus1111
Solution Sage
Solution Sage

Hi @CoordAnalytics ,

see my new pbi file. I hope now it is good.

https://1drv.ms/u/s!Aj45jbu0mDVJizDXMvR1_j8dnilA?e=x55QRg

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

mangaus1111
Solution Sage
Solution Sage

Hi @CoordAnalytics ,

try this measure

Business days between order sequence 1 and order sequence 2 =
INT(CALCULATE(MAX('Facts9'[Change Date]),'Facts9'[Order_Sequence]=2) - CALCULATE(MAX('Facts9'[Change Date]),'Facts9'[Order_Sequence]=1))
 
Here there is the pbi file
 
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

If I'm reading that correctly, that's going to count the number of days between the two, but I need the number of business days. For context, sequence 2 is supposed to occur within three business days of sequence 1. I need to know how many orders had sequence 2 occur more than 3 business days after sequence 1. For example, if sequence 1 happens on Friday and is sequence 2 happens on Tuesday, that still happened within 3 business days, but just finding the difference between the days would say 4 or 5 days. Does that make sense? That's why I'm getting to tripped up. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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