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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Data Import limit based on 3 fields in power query

Hi Power Users,

 

I'm trying to import some data into power bi and would like to limit the number of records using 3 fields. below is the data looks like. 

 

SessionSessionmonthSessio DateAmount
S-1November11/5/2020100
S-2November11/18/2020100
S-3November12/4/2020100
AdhocNovember12/5/2020100
S-1December12/8/2020100
S-2December12/20/2020100
S-1January1/5/2021100
S-2January1/20/2021100
S-3January2/1/2021100
    

 

By using Session,SessionMonth,SessionDate i would like to load only recent data. For example for November i would like to load Adhoc and for December would like to load S-2 and for january would like to load S-3. 

 

Please help.

 

Thanks,

3 REPLIES 3
HotChilli
Super User
Super User

Add a step in Power Query:

Table.SelectRows(#"Changed Type", each 
(([Sessionmonth] = "November" and [Session] = "Adhoc") or 
 ([Sessionmonth] = "December" and [Session] = "S-2") or 
 ([Sessionmonth] = "January" and [Session] = "S-3")))

#"Changed Type" is the name of the previous step

Anonymous
Not applicable

@HotChilli  Thanks for the reply. session  might be change for every month, its not static. 

Hi @Anonymous 

To change the session values dynamically, you may want to use the Query Parameters

112303.jpg

Then reference the parameters in Advanced Editor:

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Sessionmonth] = "November" and [Session] = Session1) or ([Sessionmonth] = "December" and [Session] = Session2) or ([Sessionmonth] = "January" and [Session] = Session3))

 

More references:

https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/

https://www.biinsight.com/power-bi-desktop-query-parameters-part2-dynamic-data-masking-and-query-parameters/

 

Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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