Forum Discussion
Previous function employee
- 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])
try this code :
Thank you for your respons and help Daniel29195.
Unfortunately this code doesn't work for me. I get an error after selectcolumns(..., [name1],...
Also I'm missing function c in your output.
- Daniel291952 years agoCommunity Champion
can you share the error you are getting ?
- powerbifuddaa2 years agoHelper II
- Daniel291952 years agoCommunity Champion
what is weird is that from my side i didnt get any error .
could you pllease try one of the following :
1. add the table name before the column name , so instead of [FunctionName] , write : Table_Name[FunctionName] ( with table_name = the table name you have in your model )
if this doesnt work,
try this :
SELECTCOLUMNS(offset(-1,datasource,ORDERBY('Table (4)'[FunctionChangedDate] , asc )),"col" , Table_Name[FunctionName])add the text in boldlet me know if it works for you