This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
at this moment I have a table which looks similar to this:
Date Liters Group
2022-08-30 65.22 1
2022-08-28 33.12 1
2022-08-27 42.29 1
2022-08-26 43.69 1
2022-08-25 78.22 1
2022-08-23 28.79 1
2022-08-20 46.58 1
2022-08-19 45.27 1
2022-08-18 19.62 1
In my table I filter out 36 most recent records for each group and I am looking for a way to measure average values in 'Liters' column in groups of 3, for instance when we take first 3 rows: (65.22+33.12+42.29)/3=46.88. That way I would get 12 different values from 36 rows. Another problem with this table is that the values are taken from sharepoint and are always receiving new records, but this statistic needs to be done on 36 most recent entries. Filtering by hand is very time consuming, so I am looking for ways to make this automatic. If anyone has any ideas, how this can be done, your help would be appreaciated.
Solved! Go to Solution.
@RSip , Create a column rank first
Rank = rankx(filter(Table, [group] = earlier([Group]) ), [Date], , desc, dense)
now you can use filter rank <=3 in measure
or create another column
Sum= AverageX(filter(Table, [group] = earlier([Group]) && [Rank] <=3),[Liters] )
Or create measure like
cnt = countx(filter(allselected(Table),[group] = max([Group])), [Date])
Sum= AverageX(filter(Values(Table[group]), [cnt ]<=3),calculate(Sum([Liters])) )
@RSip , Create a column rank first
Rank = rankx(filter(Table, [group] = earlier([Group]) ), [Date], , desc, dense)
now you can use filter rank <=3 in measure
or create another column
Sum= AverageX(filter(Table, [group] = earlier([Group]) && [Rank] <=3),[Liters] )
Or create measure like
cnt = countx(filter(allselected(Table),[group] = max([Group])), [Date])
Sum= AverageX(filter(Values(Table[group]), [cnt ]<=3),calculate(Sum([Liters])) )
Thank you very much. It solved the problem.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 42 | |
| 41 | |
| 21 | |
| 20 |