Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

IF ELSE for DATE

Hello, i have formula below and i would like to modify them into a new tagging..      SSD = IF( 'Open Orders_BOM'[SCHEDULE_SHIP_DATE] < TODAY(), "Backlog", IF('Open Orders_BOM'[SCHEDU...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    You can create a new table as follows, this table does not create any relationship with the main table.

     

    In my main table, today in your formula I took the fixed date October 20, 2021.

     

    Now create the measure as

    Component Code = 
    SWITCH (
        MAX ( 'Table'[SSD] ),
        "Backlog",
            CALCULATE (
                SUM ( 'Open Orders_BOM'[Component Code] ),
                FILTER ( 'Open Orders_BOM', [SSD] IN { "Backlog", "N5D", "Today" } )
            ),
        "Today",
            CALCULATE (
                SUM ( 'Open Orders_BOM'[Component Code] ),
                FILTER ( 'Open Orders_BOM', [SSD] IN { "Backlog", "Today" } )
            ),
        "Future",
            CALCULATE (
                SUM ( 'Open Orders_BOM'[Component Code] ),
                FILTER ( 'Open Orders_BOM', [SSD] = "Future" )
            )
    )
    

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.