Forum Discussion
Find match in previous value
Hi, I'm looking for a solution for the below issue,
I have a table where in every day I get new data post refresh, I want to check the data of a perticular column eg: Name in the below table and see if this exists for previously (previous days) and if there is a match then I would like to have a Yes/No column defined as out put column
Which function can I use to attain this?
Note: I don't have 2 table data its only one table
| Date | Name | City |
| 06-01-2021 | SUDHAKAR | Bangalore |
| 07-01-2021 | SWETHASRI | US |
| 08-01-2021 | SQUIRES | ASIA |
| 09-01-2021 | CIAMPA | Europe |
| 10-01-2021 | ONALFO | Bangalore |
| 11-01-2021 | SHRISUNDER | US |
| 12-01-2021 | DAWOOD | ASIA |
| 13-01-2021 | SHEIKH | Europe |
| 14-01-2021 | GOYAL | Bangalore |
| 15-01-2021 | CHANDHOKE | US |
| 16-01-2021 | DAS | ASIA |
| 17-01-2021 | INDORIA | Europe |
| 18-01-2021 | JOSHI | Bangalore |
| 19-01-2021 | KHOCHARE | US |
| 20-01-2021 | MISRA | ASIA |
| 21-01-2021 | SUDERSAN | Europe |
| 22-01-2021 | WADHWANI | Bangalore |
| 23-01-2021 | DAWOOD | US |
| 24-01-2021 | SINGH | ASIA |
| 25-01-2021 | DESAI | Europe |
| 26-01-2021 | RAWAT | Bangalore |
| 27-01-2021 | AKHTER | US |
| 28-01-2021 | KHAN | ASIA |
| 29-01-2021 | MUZAMMIL | Europe |
| 30-01-2021 | RAFIQ | Bangalore |
| 31-01-2021 | SIDDIQI | US |
| 01-02-2021 | SOHAIL | ASIA |
| 02-02-2021 | PATEL | Europe |
| 03-02-2021 | NAYYAR | Bangalore |
| 04-02-2021 | PANDEY | US |
| 05-02-2021 | BALAKRISHNAN | ASIA |
| 06-02-2021 | GOVEKAAR | Europe |
| 07-02-2021 | SOMACHUDAN | Bangalore |
| 08-02-2021 | JEWALIKAR | US |
| 09-02-2021 | ACUÑA | ASIA |
- Previous days Name exist? CC =VAR _currentdate = Data[Date]VAR _previousdaystablenamecolumn =SUMMARIZE ( FILTER ( Data, Data[Date] < _currentdate ), Data[Name] )RETURNIF ( Data[Name] IN _previousdaystablenamecolumn, "Yes", "No" )
5 Replies
- Jihwan_Kim
Super User
Previous days Name exist? CC =VAR _currentdate = Data[Date]VAR _previousdaystablenamecolumn =SUMMARIZE ( FILTER ( Data, Data[Date] < _currentdate ), Data[Name] )RETURNIF ( Data[Name] IN _previousdaystablenamecolumn, "Yes", "No" ) - AnonymousNot applicable
Thanks for picking up my query, Appreciate it.
I want to know if one more time Dawood name appears will the previous value become "No" and current date value becomes "Yes" ?
- Jihwan_Kim
Super User
Thanks for the feedback.
If one more Dawwod is added, 1st previous Dawood already has the 2nd previous Dawood.
So, I think, it will still show yes.
You can try.
- AnonymousNot applicable
Thanks that works. I have a query regards to report.
If I have to create a measure to display the count as to number to names that has been found previously as of today (I want to consider the last refresh day or the recent date in date column for this calculation)
- AnonymousNot applicable
Hi Anonymous,
Perhaps you can try to use today function to replace the variable with the current date and use it to calculate. Then the calculated result will auto changes based on system DateTime.
Notice: power bi data model does not include cache history records features, these results will be replaced every time the system datetime changes.
Regards,
Xiaoxin Sheng