Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I am trying to use a Matrix to display this data so that I can nest the columns. I want to show the most recent Sample Date and the coresponding Action and Lab report number. The Matrix summarizes these fields seperately. How can I ensure the Action and Lab report number are coming from the same row as the Latest Sample Date?
Solved! Go to Solution.
@austinhammer So this is a double lookup. Watch the end of this video for the technique.
@austinhammer So this is a double lookup. Watch the end of this video for the technique.
Thanks @Greg_Deckler - great video!
RecentAction =
VAR __Table = 'SOS'
VAR __MaxDate = MAXX(__Table, [Sample Date])
VAR __ActionTable = FILTER(__Table, [Sample Date] = __MaxDate)
VAR __Result = SELECTCOLUMNS(__ActionTable, [Action])
RETURN
__Result
@austinhammer So I would normally implement it as something like this:
RecentAction =
VAR __Table = 'SOS'
VAR __MaxDate = MAXX(__Table, [Sample Date])
VAR __ActionTable = FILTER(__Table, [Sample Date] = __MaxDate)
VAR __Result = MAXX(__ActionTable, [Action])
RETURN
__Result
RecentLab =
VAR __Table = 'SOS'
VAR __MaxDate = MAXX(__Table, [Sample Date])
VAR __ActionTable = FILTER(__Table, [Sample Date] = __MaxDate)
VAR __Result = MAXX(__ActionTable, [Lab])
RETURN
__Result
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |