Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Power Query Formula's for Dates RAG Status

Hello i'm looking to add some custom collumns to highlight Red, Amber,Yellow & White from a Date collum in Power BI.   So basically, my date collumn is called "Fix Target"   Anything Before today...
  • mahenkj2's avatar
    4 years ago

    Hi Anonymous ,

    Incase you would like to add custom column, one way is as below:

     

     

    Output is as below:

     

    Formulae I used:

    if [Fix Target]=Date.From(DateTime.LocalNow()) then "Amber" else if [Fix Target]=Date.AddDays(Date.From(DateTime.LocalNow()),1) then "Yellow" else if [Fix Target]>Date.AddDays(Date.From(DateTime.LocalNow()),1) then "White" else "Red"

     

    Just ensure proper functionality.

     

    If you intended color formatting to your date column, just use this custom column in formatting logic.

     

    Hope it helps.