Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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]...
  • artemus's avatar
    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"