Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Faber13
Helper II
Helper II

LAST DATE WITH FILTERS (URGENT)

 

I need it to show only the date 09/25/2021 in the historical date line 06/16/2022 (the day the date was changed from 09/24/2021 to 09/25/2021) the rest must be blank.

 

 

Faber13_0-1657634724452.png

 

6 REPLIES 6
pranit828
Community Champion
Community Champion

Hi @Faber13 

Hope, the below DAX column creation helps with your task.

_Change = 
VAR Pre_date = CALCULATE(MAX(Table[data vencimento]), FILTER(table,table[data historico]=EARLIER(Table[data historico])))
VAR NN_Pre_date = IF(ISBLANK(Pre_date), Table[data vencimento], Pre_date)
RETURN IF(NN_Pre_date <> Table[data vencimento], Table[data vencimento], blank())

 

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi @pranit828 

 

unfortunately it didn't work, it's pulling the value for each line.

I tried the calculated column below and I didn't get the expected result either

 

teste1 =
if([Data vencimento] = maxx(filter(Fvalidade, [ID] =earlier(Fvalidade[ID]) && Fvalidade[Data Historico] = earlier(Fvalidade[Data Historico]) -1) ,Fvalidade[Data Vencimento]), BLANK() , Fvalidade[Data Vencimento])
 
 
Faber13_0-1657647877373.png

 

Hi @Faber13 

Try this instead, it worked for me. 

_Change = 
VAR _Pre_date = CALCULATE(MAX('Table'[Data Vencimento]), FILTER('Table','Table'[Data Historico]<EARLIER('Table'[Data Historico])))
VAR NN_Pre_date = IF(ISBLANK(_Pre_date), 'Table'[Data Vencimento], _Pre_date)
RETURN IF(NN_Pre_date <> 'Table'[Data Vencimento], 'Table'[Data Vencimento], blank())

pranit828_0-1657662250089.png

 

 

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

hi @pranit828,

 

still not working, if database is attached to facilitate - ID is the junction of other 3 columns.

 

IDData HistoricoCodigo MaterialLoteLote FornecedorData Vencimentoteste1teste2Coluna_Change_Change2
100191263C04HE809918633831/05/2022100191263C04HE809918633824/09/202124/09/2021  24/09/202124/09/2021
100191263C04HE809918633802/06/2022100191263C04HE809918633824/09/202124/09/2021  24/09/202124/09/2021
100191263C04HE809918633803/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633804/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633805/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633806/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633807/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633808/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633809/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633810/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633811/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633812/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633813/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633814/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633815/06/2022100191263C04HE809918633824/09/2021   24/09/202124/09/2021
100191263C04HE809918633816/06/2022100191263C04HE809918633825/09/202125/09/202125/09/202125/09/202125/09/202125/09/2021
100191263C04HE809918633817/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633818/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633819/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633820/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633821/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633822/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633824/06/2022100191263C04HE809918633825/09/202125/09/202125/09/202125/09/202125/09/202125/09/2021
100191263C04HE809918633825/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633826/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021
100191263C04HE809918633827/06/2022100191263C04HE809918633825/09/2021 25/09/2021 25/09/202125/09/2021

 

 

Faber13_0-1657719623231.png

 

Hi @Faber13 

You have got the solution to the initial problem that you created this thread for.

You should accept my reply as solution and create a new thread with new data points.





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Hi @pranit828 , 

 

it still didn't work.   

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.