Forum Discussion

NourJ's avatar
NourJ
Icon for Helper III rankHelper III
3 years ago
Solved

Specific Calendar conditions by DAX

I would like to generate a calendar table using DAX that is based on another column in my table. My current table does not contain a date or month column, but it does have a "Round" column that sta...
  • ppm1's avatar
    3 years ago

    Here's an example that shows one way to do it.

    DatesRound =
    VAR startdate =
        DATE ( 2022, 5, 1 )
    RETURN
        ADDCOLUMNS (
            CALENDAR ( startdate, DATE ( 2023, 4, 30 ) ),
            "Round",
                42
                    + ROUNDDOWN ( DATEDIFF ( startdate, [Date], MONTH ) / 2, 0 )
        )

     

     

    Pat