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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MSuser5
Helper III
Helper III

create calendar based on source date

Hi All,

 

I have source file dates starting from 31/01/2021 to till yesterday ( November 7th 2023) as i have created calendar table based source first date and lastdate.

But while using into calendar date as in slicer it's appearing  till December 2023.

 

calender = CALENDAR(FIRSTDATE('For Loading'[Day]), LASTDATE('For Loading'[DAY]))
 
Issue below :
Capture1.PNG
 
 
Kindly suggest how to avoid and get till last date of source file.
 
Thanks,
MS
1 ACCEPTED SOLUTION

you disable this option

Screenshot_1.png

View solution in original post

6 REPLIES 6
Ahmedx
Super User
Super User

try this

Calendar = 
VAR BaseCalendar =
    CALENDAR (MIN('For Loading'[DAY]) , MAX('For Loading'[DAY]))
RETURN
    GENERATE (
        BaseCalendar,
        VAR BaseDate = [Date]
        VAR YearDate = YEAR ( BaseDate )
        VAR MonthNumber = MONTH ( BaseDate )
        VAR YearMonthNumber = YearDate * 12 + MonthNumber - 1
        RETURN ROW (
            "Year", YearDate,
            "Month Number", MonthNumber,
            "Month", FORMAT ( BaseDate, "mmmm"),
            "Year Month Number", YearMonthNumber,
            "Year Month", FORMAT ( BaseDate, "mmm yy")
        )
    )

Hi @Ahmedx ,

 

Still no luck FYI,

Capture1222.PNG

if it doesn’t work, check your data, it’s all there December

you disable this option

Screenshot_1.png

Idrissshatila
Super User
Super User

@MSuser5 ,

 

can you try min and max instead of startdate and lastdate.

 

can you also make sure from the data view that there's no record for december.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




@Idrissshatila ,

I'm sure there is no data for december  and i have tried for MIN , MAX condition but no luck.

FYI,

Capture12.PNG

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.