Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

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

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    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