Forum Discussion
Calculate and visualize lead time
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"
)
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.
- amitchandak4 years agoSuper User
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/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-kdatediff in direct query
- Clay824 years agoFrequent Visitor
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.