Forum Discussion

Ada_Danelle's avatar
Ada_Danelle
New Member
3 years ago
Solved

Add extension column with If Statement

Good day experts   I am trying to add a column to an existing table in the data view using a DAX query. The requirement is to determine the second half of the fiscal year using today's date. If the...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Ada_Danelle ,

    I created a sample pbix file(see the attachment), please check if that is what you want. Please update the formula of calculated table as below:

    Calendar = 
    ADDCOLUMNS (
        CALENDAR (
            IF (
                MONTH ( TODAY () ) < 10,
                DATE ( YEAR ( TODAY () ) - 1, 10, 1 ),
                DATE ( YEAR ( TODAY () ), 10, 1 )
            ),
            IF (
                MONTH ( TODAY () ) < 10,
                DATE ( YEAR ( TODAY () ), 3, 31 ),
                DATE ( YEAR ( TODAY () ) + 1, 3, 31 )
            )
        ),
        "Type", "HTD2 (Oct - Mar) ",
        "Order", 3
    )

    Best Regards