Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
clarawang_12
Frequent Visitor

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])
)
clarawang_12_0-1680010710451.png

 

 

1 REPLY 1
johnt75
Super User
Super User

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] )
)

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.