Forum Discussion
powerbifuddaa
2 years agoHelper II
Previous function employee
Hello, I would like to make a calculated column with the PreviousFunctionName of an employee. Person_BK FunctionChangedDate FunctionName PreviousFunctionName 555 1-12-2020 function A nu...
- 2 years ago
ok i got you
you needed to be partitioned by pperson_bk
step0 :
you need to fix the column functionchangedate to respect the following format :
m-dd-yyyy
step1 : go to power query and change the column functionchangeddate type from text to date
step 3 : in power query sort asc the first column :
step 4 :
sort functionchangeddate column asc
save and apply.
step 5 :
use this measure now :Column =var current_perosn = 'Table (7)'[Person_BK]var current_date = 'Table (7)'[FunctionChangedDate]var datasource =FILTER(all('Table (7)'[FunctionChangedDate],'Table (7)'[FunctionName],'Table (7)'[Person_BK]),'Table (7)'[Person_BK] = current_perosn && 'Table (7)'[FunctionChangedDate] <=current_date&& 'Table (7)'[FunctionChangedDate] <=current_date)returnSELECTCOLUMNS(offset(-1,datasource,ORDERBY('Table (7)'[FunctionChangedDate] , asc ),PARTITIONBY('Table (7)'[Person_BK])),[FunctionName])
Ashish_Mathur
2 years agoSuper User
Hi,
Share both tables in a format that can be pasted in an MS Excel file.
powerbifuddaa
2 years agoHelper II
Hi Ashish_Mathur ,
I am afraid that I do not know what you mean.
I have included the pbix file (PowerBI file). I hope that will help.
Thanx and regards, Elmer
- Ashish_Mathur2 years agoSuper User
Hi,
Your question has already been answered by another user.