Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
Based on the simple table table structure below can some show me an example of the dax forum that will show which salesperson last sold to that customer. It would be added as a column\measure to the customer table.
Thank you
Tony
Invoice
Solved! Go to Solution.
Hi, my alternative solution would be a measure like this:
LastSoldBy = CALCULATE ( VALUES ( Sales[SalesPerson] ), FILTER ( RELATEDTABLE ( Sales ), Sales[InVDate] = MAX ( Sales[InVDate] ) ) )
Hi
I think a new column with this formula should do what you want:
LastSoldBy = LOOKUPVALUE( Sales[SalesPerson]; Sales[InvDate];MAXX(RELATEDTABLE(Sales);Sales[InvDate]); Customers[CustomerID];Customers[CustomerID] )
I am sure there's a better solution and I am curious to see it myself. Anyway, I hope this helps for now.
JJ
Hi, my alternative solution would be a measure like this:
LastSoldBy = CALCULATE ( VALUES ( Sales[SalesPerson] ), FILTER ( RELATEDTABLE ( Sales ), Sales[InVDate] = MAX ( Sales[InVDate] ) ) )
Hi Victor
Thanks for sharing, your solution probably is faster!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
78 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |