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
ieatwood
Regular Visitor

Calculation of open order on planning

Hi everyone,

 

I'm struggling with finding the right DAX code to get my open orders planned for each day that exist over time.

 

My first table (Productions) consists:

Production IDDate OrderedDate on Planning
FR10010/10/202218/10/2022
NL10121/10/202224/10/2022
IT10222/10/202225/10/2022
FR10323/10/202229/10/2022
DE10426/10/20222/11/2022
NL10528/10/20222/11/2022
BE1061/11/20225/11/2022
FR1072/11/20226/11/2022
FR1083/11/20227/11/2022

 

I also have a basic calendar table related to Date Ordered and Date on Planning (secondary) to do some reporting on these dates.

 

However, what I want to accomplish is the following:

 

I want to create a measure to get the "Open Doors on Planning":

>> this should count all my (Production ID) where (Date Ordered) <= Date && (Date Planned) >= Date

  • Date should be a continious timeframe of all Dates from a table (probably unlinked new table?)
  • I think it should be done with a measure countrows but i struggle to relate this measure on a date table unrelated to my existing Productions table.
  • Can anyone help me figuring out which measure will help me get the below "Open Doors on Planning" and how to fit it on an unrelated date table?

 

So it should result in:

DateOpen Doors on Planningwhich doors?
8/10/20220none
9/10/20220none
10/10/20221FR100
11/10/20221FR100
12/10/20221FR100
13/10/20221FR100
14/10/20221FR100
15/10/20221FR100
16/10/20221FR100
17/10/20221FR100
18/10/20221FR100
19/10/20220none
20/10/20220none
21/10/20221NL101
22/10/20222NL101, IT102
23/10/20223NL101, IT102, FR103
24/10/20223NL101, IT102, FR103
25/10/20222IT102, FR103
26/10/20222FR103, DE104
27/10/20222FR103, DE104
28/10/20223FR103, DE104, NL105
29/10/20223FR103, DE104, NL105
30/10/20222DE104, NL105
1/11/20223DE104, NL105, BE106
2/11/20224DE104, NL105, BE106, FR107
3/11/20223BE106, FR107, FR108
4/11/20223BE106, FR107, FR108
5/11/20223BE106, FR107, FR108
6/11/20222FR107, FR108
7/11/20221FR108
8/11/20220none

 

 

If any other questions please let me know.

Thanks a million!

Tim

 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @ieatwood ,

 

Please check the measure:

Measure = CALCULATE(COUNT(Productions[Production ID]),FILTER(ALLSELECTED(Productions),Productions[Date Ordered]<=SELECTEDVALUE('Calendar'[Date])&&Productions[Date on Planning]>=SELECTEDVALUE('Calendar'[Date])))+0

vjaywmsft_0-1669628528519.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @ieatwood ,

 

Please check the measure:

Measure = CALCULATE(COUNT(Productions[Production ID]),FILTER(ALLSELECTED(Productions),Productions[Date Ordered]<=SELECTEDVALUE('Calendar'[Date])&&Productions[Date on Planning]>=SELECTEDVALUE('Calendar'[Date])))+0

vjaywmsft_0-1669628528519.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

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.