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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
SanderBeukers
Advocate I
Advocate I

Limit query results by filtering a column with a MAX function

Hi All,

 

I'm working on a report which pulls data from a database which contains about 200K rows per monthly snapshot. The report only has to contain data from the latest monthly period (ergo: the MAX or TOP 1 descending value of column "Period"). I can filter this in the report layer with DAX, but my goal is to filter it in the query editor itself, so the initial load won't have to load 200K times the amount of periods and will automatically pull new periods when the refresh hits. I've found the Table.Max and the List.Max functions, but i'm not quite sure how to use them correctly in the query editor.

 

Any thoughts?

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-caliao-msft
Microsoft Employee
Microsoft Employee

@SanderBeukers,

 

Which databse are you connecting? If you use relational database, you can add this filter in your query.

 

Besides, you could use the embedded filter to filter your date.
Capture.PNG

 

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Microsoft Employee
Microsoft Employee

@SanderBeukers,

 

Which databse are you connecting? If you use relational database, you can add this filter in your query.

 

Besides, you could use the embedded filter to filter your date.
Capture.PNG

 

Regards,

Charlie Liao

Thanks, i wasnt aware if this built in feature.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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