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
ThreeChanges
New Member

Query Top N from Azure Table

Hi,

 

I am trying to get only the Top N entries from an Azure Table. Loading all hundres of GB would take hours and crash PowerBI, so I need to limit the results. Also, doing a filter on the timestamp is super slow.

 

I tried Table.FirstN, but it seems to load all entries from the table and then only take the first N in memory. I am looking for something similar to the Azure Table REST query param: https://myaccount.table.core.windows.net/Customers()?$top=10 (from https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities)

 

Is there a way to do this in Power BI?

 

My query looks like this:

let
Source = AzureStorage.Tables("azuretableurl"),
monitorlogs1 = Source{[Name="tablename"]}[Data],
filteredLogs1 = Table.SelectRows(monitorlogs1, each [PartitionKey] = "mail"),
topLogs1 = Table.FirstN(filteredLogs1, 100000),
#"Expanded Content" = Table.ExpandRecordColumn(topLogs1, "Content", {"AvgSetDuration", "AvgGetDuration", "AvgDeleteDuration", "AvgResponse", "AvgMailSchedule", "StuckMails"}, {"Content.AvgSetDuration", "Content.AvgGetDuration", "Content.AvgDeleteDuration", "Content.AvgResponse", "Content.AvgMailSchedule", "Content.StuckMails"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Content",{{"Content.AvgMailSchedule", "MailSchedule"}, {"Content.StuckMails", "StuckMails"}})
in
#"Renamed Columns"

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ThreeChanges,

 

I don't think there is a better solution here in this scenario currently. Here is a similar idea about filtering azure table storage from the URL share on Power BI Ideas for your reference. You can vote it up and add your comments there to improve Power BI on this feature. Smiley Happy

 

Regards

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
Top Kudoed Authors