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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.