Forum Discussion

clarawang_12's avatar
clarawang_12
Frequent Visitor
3 years ago

Need help on Dynamic Calendar measures.

Dear all,

 

I have created a measure that shows dynamic calendar, which ranges from first date to last date of certain report.

However errors popped out, can you pls shed a light on this measure? Thanks.

----------------------------------------------

DynamicDate = ADDCOLUMNS(
CALENDAR(FIRSTDATE('TicketList'[Created]),LASTDATE('TicketList'[Created])),
"Year",YEAR([Date]),
"Quarter",ROUNDUP(MONTH([Date])/3,0),
"Month", MONTH([Date]),
"Week",WEEKNUM([Date]),
"Month Year",YEAR([Date]) * 100 + MONTH([Date]),
"WeekDay",WEEKDAY([Date])
)

 

 

1 Reply

  • Do you have auto date/time enabled? If so I think you would need to use

    DynamicDate =
    ADDCOLUMNS (
        CALENDAR (
            MIN ( 'TicketList'[Created].[Date] ),
            MAX ( 'TicketList'[Created].[Date] )
        ),
        "Year", YEAR ( [Date] ),
        "Quarter", ROUNDUP ( MONTH ( [Date] ) / 3, 0 ),
        "Month", MONTH ( [Date] ),
        "Week", WEEKNUM ( [Date] ),
        "Month Year",
            YEAR ( [Date] ) * 100
                + MONTH ( [Date] ),
        "WeekDay", WEEKDAY ( [Date] )
    )