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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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