The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
18 | |
13 | |
9 | |
5 |