Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
How do you calculate the last 3 row values into a messure?
E,g
value New Messure
10 31
11 30
10 22
9 16
3 7
4 4
Test it separately.
The FILTER statement creates a table so Hit New Table in powerbi and paste in that part of the statement. You can use a variable instead of SELECTEDVALUE ( 'Events'[End Date/Time]) - hardcode the value to be a datetime you have in the table.
You can then see what that part of the code does.
Thank you,
Yes i can see that beacuse the date and time stamp are identical they are both assinged the same value so i need to order the data. this is a problem to other data in the set.
My code works for this small example but only because of the unique index
I used this code to order the data that was filtered
So i would need to either differenate the 1,1,2,2 to 1,2,3,4 or another option to count in groups of 4 ?
I can use the date
I used the following code i found online which looks to SUM the filtered values, which would be around 24,366 but i dont understand the last part of the code which references the date and + 3
if i look at the last 4 values the sum will always be the same unless data is missing due to it being repetitive
You filter the data to find the last 3 values based on some ordering (either an index or a date field) and then sum the values.
If the ordering is regular, it can be simpler e.g. index of 1,2,3,4 but otherwise you might have to use TOPN
Do you have an ordering?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
68 | |
53 | |
39 | |
33 |
User | Count |
---|---|
70 | |
63 | |
57 | |
49 | |
46 |