Forum Discussion
Calculate Net Working Days from dates in two different tables
- 3 years ago
Hi,
This calculated column formula in the ALL FYs table works
Column = LOOKUPVALUE('Perf metrics'[Contract Signed Date],'Perf metrics'[(PR) PR No.],'all Fys'[(PR) PR No.],'Perf metrics'[(PR) PR Item No.],'all Fys'[(PR) PR Item No.])Hope this helps.
- 3 years ago
Hi,
That error message means that there are duplicate entries appearing in the PR_REF_NO column of the System PR table.
Hi Ashish,
Thanks for your enlightening advice.
I've checked and found that there were indeed duplicates of PR_REF_NO as there were more than one START DATE for some of the PR_REF_NO. I further confirmed that we can use the latest date if this occurs. However, after sorting both the PR_REF_NO and the START DATE, I am at a loss how to extract only the correct date. I tried to use the conditional column method, but there seems to be no way to indicate this condition here. Is it possible to do a if-else condition whereby if PR_REF_NO is duplicated, only extract the later date of whatever number of Start Dates available for each of this non-unique PR_REF_NO?
Thanks so much for helping with this!
Hi,
Share some data and show the expected result.
- shermayne1233 years agoHelper I
Hi Ashish,
While waiting I thought of a method i.e. to delete the duplicate records with the earlier start dates , by sorting the PR_REF_NO in ascending order and START DATE in descending order, assuming the software will delete the second record which has the earlier date, but it deleted the later date instead. When I resort it by ascending order, it will delete the second record with the later date and keep the first one with the earlier date. So this method doesn't work.
Below is my table and the expected result in column "Selected Start Date":
System PR table PR_REF_NO START_DATE Selected Start Date PR-12345 4/4/2022 record to be deleted PR-12345 5/5/2022 5/5/2022 PR-67890 3/3/2022 record to be deleted PR-67890 4/5/2022 4/5/2022 PR-11121 3/6/2022 3/6/2022 PR-14589 6/6/2022 6/6/2022 Hope you can help, thanks!!
- shermayne1233 years agoHelper I
Hi Ashish,
Good news is I managed to use GroupBy method to get the most recent date/selected start date column populated by PR_REF_NO. Then I tried to lookup the value of this date into the Perf Metrics table as before using the same code:
System PR Start Date = LOOKUPVALUE('System PR Report'[Most Recent Start Date],'System PR Report'[PR_REF_NO],'Perf Metrics'[PR_Ref?])This time I have no errors but I did a random check on one system PR that's supposed to have a Most Recent Start Date but it wasn't reflected in the Perf Metrics table i.e. the field was blank which was incorrect. Please advise what seems to be the issue, thanks!- shermayne1233 years agoHelper I
Hi Ashish,
I further checked with my colleague and confirmed that the problem it is possible for Perf Metrics table not to have all the system PRs due to timing issue. As such, I'll close this query, thanks so much!!