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
bearpoz79
Helper I
Helper I

formula placement

Hi,

trying to figure out how to best model this formula.

 

I have a simple sales table (however my actual data is very large, but for this example i'm using simple columns).

 

Order NumberShip datepromise datesales $
20002/10/20202/13/20205
20012/10/20202/10/202010
20022/11/20201/25/20205
20032/11/20202/15/202010
20042/12/20202/11/20205
20052/12/20202/12/202010
20062/13/20202/1/202015
20072/13/20202/13/202020
20082/14/20202/1/202025
20092/14/20203/1/202025
20092/14/20202/10/202030

 

The formual we set up in excel is for on time delivery between promise and actual dates. 

 

My instinct says to add columns and create formulas similar to how i have in my excel file for days late and OTD flag (see below).

 

Order NumberShip datepromise datesales $Workdays lateOTD Flag
20002/10/20202/13/20205              3On Time
20012/10/20202/10/202010             -  On Time
20022/11/20201/25/20205          (13)over 5 days late
20032/11/20202/15/202010              3On Time
20042/12/20202/11/20205            (3)1 to 5 days late
20052/12/20202/12/202010             -  On Time
20062/13/20202/1/202015          (10)over 5 days late
20072/13/20202/13/202020             -  On Time
20082/14/20202/1/202025          (11)over 5 days late
20092/14/20203/1/202025            10On Time
20092/14/20202/10/202030            (6)over 5 days late

 

Knowing that i'm not very fluent in PBI, i was wondering if there is another way to either quicken the process time for the user or enhance visuals to do it another way.  I am still not sure how the "new table" in modeling works. 

 

Thanks for the feedback.

 

 

1 ACCEPTED SOLUTION

Thanks guys but I found this link was helpful for what i was trying to do.  So far i think it works

 

https://www.sqlbi.com/articles/counting-working-days-in-dax/

 

 

View solution in original post

5 REPLIES 5

Thanks guys but I found this link was helpful for what i was trying to do.  So far i think it works

 

https://www.sqlbi.com/articles/counting-working-days-in-dax/

 

 

Greg_Deckler
Super User
Super User

Seems right.

Workdays = ([promise date] - [Ship date]) * 1.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler , another question, how would i apply the calc to only show the difference for working days (excluding weekends?)

https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362#M109


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors