Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello, first of all, happy new year!
I need help with a problem that I can't solve. I am trying to summarize the data by two columns, and get the maximum date, but I want to bring the value from the status column referring to this maximum date.
Here is an example:
My data:
Person | training | validationDate | Status |
p1 | nr10 | 31/08/2022 | red |
p1 | nr10 | 01/09/2022 | blue |
p2 | nr12 | 19/09/2022 | green |
p2 | nr10 | 31/08/2022 | red |
p3 | nr11 | 20/09/2022 | red |
p4 | nr10 | 21/09/2022 | green |
p1 | nr10 | 02/09/2022 | green |
p2 | nr12 | 31/12/2022 | green |
p3 | nr11 | 12/03/2022 | blue |
p2 | nr12 | 01/01/2023 | blue |
With
SUMMARIZE(myData, myData[Person], myData[training], "maxDate", MAX(myData[validationDate]))
I get:
Person | training | maxDate |
p1 | nr10 | 02/09/2022 |
p2 | nr10 | 31/08/2022 |
p2 | nr12 | 01/01/2023 |
p3 | nr11 | 20/09/2022 |
p4 | nr10 | 21/09/2022 |
So far so good. but what's the next step?
The result I desire is:
Person | training | maxDate | Status |
p1 | nr10 | 02/09/2022 | green |
p2 | nr10 | 31/08/2022 | red |
p2 | nr12 | 01/01/2023 | blue |
p3 | nr11 | 20/09/2022 | red |
p4 | nr10 | 21/09/2022 | green |
I tried the following code:
SUMMARIZE(myData, myData[Person], myData[training], "maxDate", MAX(myData[validationDate]), "Status", SELECTEDVALUE(myData[Status]))
but the code just get the status where the summarize has a single value. I think it's a way to get the status value ordering by date, and getting the last value but I got nowhere.
Thanks for your time in helping me. Have a nice day!
Solved! Go to Solution.
You can try...
SUMMARIZE(
myData,
myData[Person],
myData[training],
"maxDate", MAX(myData[validationDate]),
"status", LOOKUPVALUE(myData[Status], myData[Person], [Person], myData[training], [training], myData[validationDate], MAX(myData[validationDate]))
)
Proud to be a Super User! | |
You can try...
SUMMARIZE(
myData,
myData[Person],
myData[training],
"maxDate", MAX(myData[validationDate]),
"status", LOOKUPVALUE(myData[Status], myData[Person], [Person], myData[training], [training], myData[validationDate], MAX(myData[validationDate]))
)
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
47 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |