Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi
I am trying to calculate the difference between the last and previous observations for each ID. In the dataset, I have multiple observations for each ID over time. As a first step, I want to create a new table with the last and previous dates. I m using GROUPBY, but I cannot apply any filter to CURRENTGROUP. What would be a better approach to the problem?
Thanks
NewTable =
Solved! Go to Solution.
@vs531 , In case you need a new column
Diff =
var _max = maxx(filter(Table, [ID] = earlier([ID]) && [Date] < earlier([Date]) ) , [Date])
return
[Score]- Maxx(filter(Table, [ID] = earlier([ID]) && [Date] =_max ) , [Score])
@vs531 , In case you need a new column
Diff =
var _max = maxx(filter(Table, [ID] = earlier([ID]) && [Date] < earlier([Date]) ) , [Date])
return
[Score]- Maxx(filter(Table, [ID] = earlier([ID]) && [Date] =_max ) , [Score])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
22 | |
17 | |
17 | |
11 | |
7 |
User | Count |
---|---|
27 | |
26 | |
12 | |
12 | |
12 |