Forum Discussion
Anonymous
6 years agoNot applicable
Switching from DAX to M for nested IFs and TODAY condition
Hi I have the following DAX statement that creates a calculated column: Paid = SWITCH( TRUE(), 'Dataset'[status] = "Open" && 'Dataset'[Due Date] < TODAY(), "Not Paid", 'Dataset'[status]...
- 6 years ago
DateTime.LocalNow and DateTime.FixedLocalNow
https://docs.microsoft.com/en-us/powerquery-m/datetime-localnow
ImkeF probably knows about the switch statement.
- 6 years ago
While you can kind of do switch in M, for what you have if/else is good enough.
E.g.
= if [status] = "Open" and [Due Date] < DateTime.FixedLocalNow() then "Not Paid" else if [status] = "Open" and [Due Date] >= DateTime.FixedLocalNow() then "To be Paid" else "Paid"
Greg_Deckler
Community Champion
6 years agoDateTime.LocalNow and DateTime.FixedLocalNow
https://docs.microsoft.com/en-us/powerquery-m/datetime-localnow
ImkeF probably knows about the switch statement.