Power Query M code
let
Source = YourTable,
AddedFlag = Table.AddColumn(Source, "IsOverdue", each [DueDate] < DateTime.LocalNow(), type logical)
in
AddedFlag
Adds a simple true/false column instead of text, which is cheaper to filter and aggregate on later.
let
Source = YourTable,
AddedFlag = Table.AddColumn(Source, "IsOverdue", each [DueDate] < DateTime.LocalNow(), type logical)
in
AddedFlag
A logical column is smaller and faster to filter on than an equivalent text column like "Yes"/"No".
Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Add a Boolean Flag Column from a Condition.