Forum Discussion
Find the difference between two dates incorporating a deadline date
- 2 years ago
Hi lennox25
You can import those tables to power query and merge between them:
extract from the string of deadlines only the number of dates :
modify data type to number
And add it to the sales date with a custom column
modify a result as a date data type
uncheck the option load to the model at the deadlines table ( you don't need it inside)
Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- 2 years ago
Hi lennox25
You can create 3 measures : "
1.total_transactions = COUNTROWS(sales)2
over_deadline = CALCULATE([total_transactions],FILTER(sales,[over deadline days]<0))3
%_over = divide ([over_deadline],[total_transactions])+ Format it as percentThe updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- 2 years ago
Hi lennox25
Add a measure :in_deadline % = 1-[%_over]The updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi lennox25 ,
You can try calculated column like below:
Deadline Date =
SWITCH (
TRUE (),
'YourTable'[Category] = "Apples", 'YourTable'[Date Delivered] + 2,
'YourTable'[Category] = "Pears", 'YourTable'[Date Delivered] + 2,
'YourTable'[Category] = "Oranges", 'YourTable'[Date Delivered] + 2,
'YourTable'[Category] = "Bananas", 'YourTable'[Date Delivered] + 1,
'YourTable'[Category] = "Grapes", 'YourTable'[Date Delivered] + 8,
'YourTable'[Date Delivered]
)Days Over Deadline =
DATEDIFF ( YourTable[Date Sold], YourTable[Deadline Date], DAY )
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thats great and seems to work perfect - how would I now go about putting the Days Over deadline into a %?
- Ritaf19832 years ago
Super User
percent from which variable?
- lennox252 years ago
Post Patron
- Ritaf19832 years ago
Super User
Hi lennox25
You can create 3 measures : "
1.total_transactions = COUNTROWS(sales)2
over_deadline = CALCULATE([total_transactions],FILTER(sales,[over deadline days]<0))3
%_over = divide ([over_deadline],[total_transactions])+ Format it as percentThe updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.