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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Order Classification Based on Dynamic Date Range

Hi everyone! First time posting here so please let me know if I need to provide any more details/clarification.

 

I am trying to create a metric that calculates if an order was Late/Not late based on certain criteria and a "Point in time" range (As of Date).  See tabular example below.

 

I am having a tough time counting the calculated measures once they are created.

 

Example of what a single orders data looks like in a table format (changes from late to not late depending on As of Date) (did not apply all of criteria yet, just difference in dates) (this is just one order, there are a lot of orders and the amount of calculations increases when you move the As of Date)(This particular OrderId has a blank readied date but some are populated)
PowerBI_ZA_1-1652750559114.png

 

Goal:

Create Visual that counts late/not late by as of Date (like a100% stacked bar)
 and have the ablility to drill down to detail data

(x Axis being As of Date)

PowerBI_ZA_6-1652751139236.png

 

 

Data:

(Date table)

PowerBI_ZA_2-1652750576190.png

 

(Order Table)

PowerBI_ZA_4-1652750878326.png

 

 

Measure Attempts:

PowerBI_ZA_0-1652752251744.png

PowerBI_ZA_0-1652752701156.png

PowerBI_ZA_2-1652752344012.png

 

Criteria: 

1. Entry Date >= As of Date
2. Calculate the Difference in days:

       2.1 If Readied Date <= As of Date, Readied Date - Scheduled Date
       2.2 If Readied Date > As of Date or Readied Date Blank, As of Date - Scheduled Date

3. Based on results in critera #2, Late if <0, Not Late >= 0 

4. Create Visual that counts late/not late by as of Date (like a100% stacked bar)
      4.1 Have the ablility to drill down to detail data

 

Assumptions: 

1. Each order id only has 1 Scheduled Date, Shipped Date, and Readied Date

 

 

1 REPLY 1
lbendlin
Super User
Super User

"I am having a tough time counting the calculated measures once they are created"  - yup - you can't measure a measure.  You need to create a different measure that has the full logic.

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.