cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Clay82
Frequent Visitor

Calculate and visualize lead time

Hi all, 

 

I am trying to calculate and visualize our supplier lead time. I want to see if the actual lead time we have stated is accurate. The problem is that I am stuck in how to even begin. I can calculate lead time between ordering date and receiving date, but then what? We have hundreds of orders placed every month from different suppliers and I want to be able to see how many of those were received on time, how many were late (exact number of days late) and how many were early (also exact days). The purpose is to tweek our erp lead time so that they match with reality.

 

Sorry for this insufficient information.

 

Thanks. 

4 REPLIES 4
amitchandak
Super User
Super User

@Clay82 , there need to be three dates or you can check based on lead time.

 

If they are column in the same table

 

New column =

var _diff = datediff( [ordering date],[receiving date], day)

//assume 2 days 

return

Switch(true() ,

_diff< 2, "Early",

_diff =2, "On Time" ,

"Late"

)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Thanks for your suggestion!

 

I forgot to mention that I cannot create any columns as I am restricted only to the modelling tab and the reporting tab. This is due to that the storage mode is direct query. So the solution can only include measures and not calculated columns. Also your soloution only gives me a true or false if late/early, correct? I need to calculate the exact lead times, not only early/late.

 

@Clay82 , you need to do bucketing based on measure

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

 

 

 

datediff in direct query

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Bucketing seems to be what I need!

Can you assist with the measure as well? I am not able to create any measures in direct query due to restrictions. I can only access the dataset as is and create measures afterwards. Same with query editor, no access. 

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors