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.
I have a table which contains separate values per day, per user. A simplified version of the schema and data
is shown below.
I'd like to return the latest value per user. In this case, the result set would look like this. Not all users are reported on the Max Date, so we have to go back to July 2 to get the latest value for User 1.
Solved! Go to Solution.
I guess the command is something like this? Does this seem correct?
MyValues= SUMMARIZE(MyTable,
MyTable[User],
"LastDate", Max(MyTable[Date]),
"ItemCount", CALCULATE((Max(MyTable[Value])),
Filter(MyTable, MyTable[Date] = Max(MyTable[Date]))))
You can do it this with a summarize table:
Tabla = SUMMARIZE(MaxTable;MaxTable[User];"LastDate";Max(MaxTable[Fecha]);"LastValue";CALCULATE(max(MaxTable[Value]);FILTER(MaxTable;MaxTable[Fecha]=Max(MaxTable[Fecha]))))
Hi @Vvelarde,
The maximum value isnt necessarily the latest entry value per user. You made a good trial but not quite perfect, i think the power query route is still the best approach to handle it.
Cheers.
@Vvelarde thanks for the pointer, but I'm afraid that your DAX won't save. I don't know what Fecha is and PowerBI is expecting commas instead of semi-colons. I can try to work through it, but I think Max() requires two values for example and I just don't know where to take this.
I guess the command is something like this? Does this seem correct?
MyValues= SUMMARIZE(MyTable,
MyTable[User],
"LastDate", Max(MyTable[Date]),
"ItemCount", CALCULATE((Max(MyTable[Value])),
Filter(MyTable, MyTable[Date] = Max(MyTable[Date]))))
I have the same problem.
I used this suggestion to my table, but it didn't work
hi @ChrisWilliams Yeah this is correct.
Fecha is Date (Spanish translation)
And My Version of PowerBI work with ; instead of , . (Regional configuration of my PC)
Ken Puls has an article on what looks like the exact same scenario, keeping the most recent entry per user. I've used it before for something similar. You might check it out and see if that helps! Even though he's doing it in Power Query outside of Power BI Desktop, he's got step-by-step instructions that should cross over.
User | Count |
---|---|
123 | |
76 | |
63 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |