Forum Discussion
Latest text value - fixed on customer
Hi all
I'm very new to PowerBI and I'm trying to move my Tableau dashboards over, however I'm extremely stuck and none of the questions/answers on the forum have helped so far.
I need to add a column showing the last person who contacted a company.
for example - the table looks like this....
| Date | Customer | Contacted by |
| 01/03/2021 | Smiths | Sally |
| 28/02/2021 | Smiths | John |
| 12/02/2021 | Hammonds | Sally |
| 02/03/2021 | Smiths | Peter |
| 22/01/2021 | Hammonds | John |
| 14/11/2020 | Cartwrights | Peter |
| 03/03/2020 | Cartwrights | Hannah |
| 21/01/2021 | Hammonds | Keith |
The results should be....
| Date | Customer | Contacted by | Last contacted by |
| 01/03/2021 | Smiths | Sally | Peter |
| 28/02/2021 | Smiths | John | Peter |
| 12/02/2021 | Hammonds | Sally | Sally |
| 02/03/2021 | Smiths | Peter | Peter |
| 22/01/2021 | Hammonds | John | Sally |
| 14/11/2020 | Cartwrights | Peter | Peter |
| 03/03/2020 | Cartwrights | Hannah | Peter |
| 21/01/2021 | Hammonds | Keith | Sally |
I've tried.....
Michsara , Try like
Last Contacted by = calculate(LASTNONBLANKVALUE('Table'[Date],MAX('Table'[Contacted By])),allexpect('Table','Table'[customer]))or
Last Contacted by = calculate(LASTNONBLANKVALUE('Table'[Date],MAX('Table'[Contacted By])),filter(allselected('Table'),'Table'[customer] = max('Table'[customer])))
2 Replies
- amitchandak
Super User
Michsara , Try like
Last Contacted by = calculate(LASTNONBLANKVALUE('Table'[Date],MAX('Table'[Contacted By])),allexpect('Table','Table'[customer]))or
Last Contacted by = calculate(LASTNONBLANKVALUE('Table'[Date],MAX('Table'[Contacted By])),filter(allselected('Table'),'Table'[customer] = max('Table'[customer])))- MichsaraRegular Visitor
That's fantastic - the first option worked. Thank you so much 😊