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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Proday83
Frequent Visitor

Retrieve number of Open Orders (by Order Types) on Weekly Basis

I'm from recently in the power BI world, I've been following the community for a few months, but this is the first time I'm asking for help. Related to that, I hope so that I will manage to properly insert all pictures and data sample this time.

 

Explanation:

On the current project, we need to implement some automatisation and I'm certain that power BI is just perfect tool for that. Right now, on every start of week (Monday in my case, English Ireland Regional Settings) we manually populate excel sheet with total number of open orders for every category (photo below). 

 

Proday83_1-1703073851319.png

 

Expected result:

I need to create one of the reports in power BI to be like this one from the picture below which is in excel and data gathered from that table above.

 

Proday83_2-1703074400766.png

 

For start, all sample data I'm providing in excel file below (two sheets, in first is data and in other calendar I created) and pictures from above just in case.

All Files Here 

 

So I have data table and I created calendar table as you can see on photos below...so I have one to many relation from date to created date, open date and closed date (not even sure which one should I use as active).

 

Proday83_3-1703075126510.png

 and calendar.

Proday83_4-1703075228390.png

Now after all I have no idea how can I write DAX to get proper result. Shall I add measure for every week of year or it is possible to do somehow more simply? Probably I should group data by week number and somehow check if Closed date > than Last day in specific week.

 

At the end, thank you for reading all of this and for your effort to help.

1 REPLY 1
Proday83
Frequent Visitor

So, two days later, I made some progress:
With this meassure below, I'm getting number of all open items weekly, but my problem is that at Monday of current week I need to have Status for week before and not for current week.

Total Number of Active Open =
VAR CurrentDate =
    MAX('Rolling Calendar Lookup'[Date]) --retrieve last day of year/month/week in my case
VAR ActiveOpen =
CALCULATE(
    COUNTROWS('KDP IW38 All Data'),
    ALL('Rolling Calendar Lookup'[Date]),
    'KDP IW38 All Data'[Open Date] <= CurrentDate
    ISBLANK('KDP IW38 All Data'[Closed Date])
    || 'KDP IW38 All Data'[Closed Date]>CurrentDate
)
RETURN
ActiveOpen

If anyone can help with this one, I am very grateful

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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