Forum Discussion

alisag's avatar
alisag
New Member
3 years ago
Solved

Odata Date filters when using Power Query

Hello All, I have the following query which is trying to fetch excahnge rates from Exchange Rate Table,     https://sandbox.operations.dynamics.com/data/ExchangeRates?$select=FromCurrency,ToCurre...
  • collinsg's avatar
    3 years ago

    Good day alisag,

    If you wish to filter to include yesterday and the day before:

    Table.SelectRows( #"Previous Step", each Date.IsInPreviousNDays( [Date], 2 ) )

     If you wish to filter to include yesterday and today:

    Table.SelectRows( #"Previous Step", each [Date] >= Date.AddDays( Date.From( DateTime.LocalNow() ), -1 ) ),

    My date column is called "Date", substitute the name of your date column anywhere I use [Date].

    These require your date column to be of type Date.

    Hope this helps.