Forum Discussion
FilipK
5 years agoResolver I
Get last value in group
Hey, assume you've got this dataset: time deviceId Version 7/29/2021 1 A 7/30/2021 1 A 7/31/2021 2 A 8/1/2021 2 A 8/2/2021 3 C 8/3/2021 1 B 8/4/2021 2 A ...
- 5 years ago
FilipK This will return your first desired table:
Table 2 = VAR __Table = SUMMARIZE('Table (5)',[deviceId],"__time",MAX('Table (5)'[time])) VAR __Table2 = ADDCOLUMNS(__Table,"__Version",MAXX(FILTER('Table (5)','Table (5)'[deviceId] = [deviceId] && [time] = [__time]),[Version])) RETURN __Table2You can use this in a measure like the following:
Measure = VAR __Version = MAX([Version]) VAR __Table = SUMMARIZE(ALL('Table (5)'),[deviceId],"__time",MAX('Table (5)'[time])) VAR __Table2 = ADDCOLUMNS(__Table,"__Version",MAXX(FILTER('Table (5)','Table (5)'[deviceId] = [deviceId] && [time] = [__time]),[Version])) RETURN COUNTROWS(FILTER(__Table2,[__Version] = __Version)) + 0This would be used in a pie chart along with your [Version] column for example.
- 5 years ago
- 5 years ago
Anonymous
5 years agoNot applicable
Hi FilipK,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements to find it more quickly.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng