Forum Discussion
Katerina_SL
Helper II
2 years agoRankNumber depends on client and timedif
Hello everyone! Could you please help me with this issue: I have table in power bi which have columns: id, client_id, order_num, created_time of order. I need to create column in this ta...
ryan_mayu
Super User
2 years agoyou can try to create two columns
Column =
VAR _last=maxx(FILTER('Table','Table'[Client_ID]=EARLIER('Table'[Client_ID])&&'Table'[Created]<EARLIER('Table'[Created])),'Table'[Created])
return if(ISBLANK(_last) || _last<EDATE('Table'[Created],-12),1,0)
Column 2 =
VAR _last=maxx(FILTER('Table','Table'[Client_ID]=EARLIER('Table'[Client_ID])&&'Table'[Created]<EARLIER('Table'[Created])&&'Table'[Column]=1),'Table'[Created])
return if('Table'[Column]=1,1,CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Client_ID]=EARLIER('Table'[Client_ID])&&'Table'[Created]>=_last&&'Table'[Created]<=EARLIER('Table'[Created]))))
pls see the attachment below
Katerina_SL
Helper II
2 years agoThank you for reply. But could you please somehow optimize this function because I have error that there if no enough memory to complete operation.