Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Issue with Filtering Data using IF ELSE Condition In Power Query

Hi Mates,   I am facing issue while filtering the data based on specific If Else Condition. So generally I have a data that I want to filter based on Current Day Name. If Current Day is 'Monday' th...
  • AlexisOlson's avatar
    4 years ago

    Try this for your red part instead:

    CurrentDate = Date.From(DateTime.LocalNow()),
    DaysToLoad = if Date.DayOfWeekName(CurrentDate) = "Monday" then 3 else 1,
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each Date.IsInPreviousNDays([Created On], DaysToLoad)),