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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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
Community Champion
Community Champion

Seems right.

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


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

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



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.