Forum Discussion

Michsara's avatar
Michsara
Regular Visitor
5 years ago
Solved

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....

DateCustomerContacted by
01/03/2021SmithsSally
28/02/2021SmithsJohn
12/02/2021HammondsSally
02/03/2021SmithsPeter
22/01/2021HammondsJohn
14/11/2020CartwrightsPeter
03/03/2020CartwrightsHannah
21/01/2021HammondsKeith

 

The results should be....

DateCustomerContacted byLast contacted by
01/03/2021SmithsSallyPeter
28/02/2021SmithsJohnPeter
12/02/2021HammondsSallySally
02/03/2021SmithsPeterPeter
22/01/2021HammondsJohnSally
14/11/2020CartwrightsPeterPeter
03/03/2020CartwrightsHannahPeter
21/01/2021HammondsKeithSally

 

I've tried.....

Last Contacted by = LASTNONBLANKVALUE('Table'[Date],MAX('Table'[Contacted By]))
but this just puts the last contact person for each line (not fixed on the customer)
 
My working Tableu formula is: {FIXED [Date] = {FIXED [Customer] : MAX ([Date])} then [Contacted by] end)}
 
Thanks in advance
  • 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

  • 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])))

    • Michsara's avatar
      Michsara
      Regular Visitor

      That's fantastic - the first option worked.  Thank you so much ğŸ˜Š