Forum Discussion

Learner82's avatar
Learner82
New Member
2 years ago
Solved

Power bi top n filter

Hi community,

I am new to power bi. I want to use top n filter to just give me too 5 rows. I don't need any basis or anything. This is just to limit the number of rows to fetch. Any parameter with which it is fastest to load.

 

I don't have any unique column and if I try date column I'll get 1000 of records Instead. Any solution?

  • lbendlin's avatar
    lbendlin
    2 years ago

    The default window is 501 rows. If your query times out or you have more than 1 million distinct values then you would have to ask the capacity admin to raise the limit. Or - rethink your setup.

7 Replies

  • MNedix's avatar
    MNedix
    Icon for Solution Sage rankSolution Sage

    Heya,

    It seems to me you just want 5 random rows from your data sample and I also understand/assume you don't want to add an Index column.

    If this is the case, you can use the SAMPLE function as below (it will return a table with 5 random rows from your table Table:

    Sample table = SAMPLE(5,'Table',1)

     

    If this solved your problem then please mark it as the solution so others can see it.

     

    Best,

     

    • Learner82's avatar
      Learner82
      New Member
      Spoiler
      I am using direct query dataset. It is just showing working on table and loading. Am I missing something? Also will the table still filter from the entire table?
      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        The default window is 501 rows. If your query times out or you have more than 1 million distinct values then you would have to ask the capacity admin to raise the limit. Or - rethink your setup.

  • Import mode or Direct Query?  

     

    You can create your own table copy (as a calculated table)

     

    Table2 = TOPN(5,Table1)

    • Learner82's avatar
      Learner82
      New Member

      I am using direct query.But then I am not able to filter from the entire data . It filters from top 5 only