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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
shb
Frequent Visitor

TopN DateTime column values

Hi,

 

I have a dataset with DateTime and Reading (int) columns. I want to show the readings over the time axis as a line graph but only for last 50 datetime values as the data is too large to show in the line graph and the user is only interested to see last 50 values. I am not sure if I can use the RANKX function as follows? This does not work as it ask to provide some aggregate function around datetime field that I am not sure which one should it be. 

 

Rank = RANKX(ALL(DatasetName), DatasetName[Datetime])  

 

Could you please suggest any alternative to achieve the above?

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee

@shb

 

You can set TOPN filter, see attached sample.

Capture.PNG

Thanks @Eric_Zhang For some reason this filter was not working on the real-time streaming dataset (on datetime field), it doesn't return anything. But for static dataset the filter does work fine. Do you know why it wouldn't work on the streaming data? Thanks

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.