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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ECC-Student
New Member

truncation

I have a database that i load in power bi and i want to work just by the 60 last lines of table.Please how to do it? Thanks in advance.

2 REPLIES 2
arify
Microsoft Employee
Microsoft Employee

Side note, in M, you can use Table.LastN library function.

 

In query editor:

Untitled.png

sornavoor
Resolver I
Resolver I

Depends on how you want the data from database to Power BI and if want to load only the last 60 rows or load all rows by work with only the last 60 rows.  assuming it is latter one, One approach will be to add a sequnce column to the db tbale import  query as shown below (oracle syntax). 

 

select (rownum - (select count(1) from <tablename>) + 60) as rowseq, tbl.* from <tablename> tbl

 

Once the data is imported,  you could then filter the table in powerbi on the column named "rowseq"  to greate  than 0. 

you could also apply this column filter on reports if you so desire.

 

If you do not want to everload more than  last 60 lines - i would suggest filtering out in the db query itself. 

 

Hope this helps.

 

Helpful resources

Announcements
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.