cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Poojad1 Helper III
Helper III

Top N and EARLIEST function in power bi

Hello,
AVG= CALCULATE( AVERAGE(FCCU[AVG]) ,FILTER(FCCU,FCCU[TS] = EARLIEST( FCCU [TS]) && TOPN(1,FCCU)))
I am trying for this give me error for earlist function .I want output as earlist record of TS top 2 records and there average .
want to show them in a table

 

 

way ealiest function not working.....

 

2 REPLIES 2
Poojad1 Helper III
Helper III

Re: Top N and EARLIEST function in power bi

top.png

 

hello,
can I do this in mesure..top 3 value and earliest ts (date) becouse i want to show that in a table so if i am directly filter that directly it will impact on hole table so i want to write measure.

regards
Pooja

Community Support
Community Support

Re: Top N and EARLIEST function in power bi

HI @Poojad1,

 

Nope, topn filter not works for measure and earliest function only works in calculate column/table.

In my opinion, I'd like to suggest you use rankx function to write a measure to get rank value, then use it in visual level filter to achieve similar topn filter effect.(is less than or equal to 3)

 

Reards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors