Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pbidemouser2
Helper II
Helper II

Display the last 5 datapoints in plot

Hi guys,

 

I have a live dataset like this,

 

Timestamp        Value

2020/06/17 1:00    12

2020/06/17 2:00    19

2020/06/17 3:00    1

2020/06/17 4:00    11

2020/06/17 5:00    19

2020/06/17 6:00    8

2020/06/17 7:00    2

2020/06/17 8:00    3

2020/06/17 9:00    4

 

I want to display this whole data as one line in a plot. And in another line i want to display only the last 5 points in different color. Is there any measure for that?. Or is it possible to show the last 5 points in different color within the same line itself?.

 

Thanks,

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @pbidemouser2 

For show last 5 data, you could try this formula:

last 5 data = IF(RANKX(ALL('Table'[Timestamp]),CALCULATE(MAX('Table'[Timestamp])),,DESC)<=5, CALCULATE(SUM('Table'[Value])) )

 

Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @pbidemouser2 

For show last 5 data, you could try this formula:

last 5 data = IF(RANKX(ALL('Table'[Timestamp]),CALCULATE(MAX('Table'[Timestamp])),,DESC)<=5, CALCULATE(SUM('Table'[Value])) )

 

Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors