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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Michsara
Regular Visitor

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
1 ACCEPTED SOLUTION
amitchandak
Super User
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])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
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])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That's fantastic - the first option worked.  Thank you so much 😊

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.