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
Anonymous
Not applicable

Asdd additional columns to calender

Hi Experts

 

how would you add the following columns to the DAX as shown below, need to get a complete calender .

 

1. Quarter&Year i.e Q3 2018

2. DaysinWeek i.e Monday = 1, Tuesday =2 etc..

3. WeekEnding

 

 

DimDate = 
ADDCOLUMNS (
    CALENDAR ( "01-01-2010", "31-12-2030"),
    "Year", YEAR ( [Date] ),
    "Quarter", CONCATENATE ( "Q", ROUNDUP ( MONTH ( [Date] ) / 3, 0 )),
    "Quarter&Year", FORMAT(    
    "Month", MONTH ( [Date] ),
    "SortMonthName", FORMAT ( [Date], "MMM" ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "Weekday", WEEKDAY ( [Date] )- 1,
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "Mth&Yr", FORMAT ([Date], "MMMM YYYY"),   
    "SortMonth&Year", FORMAT([Date], "MMM" & " " & "YY"),
    "Sort", FORMAT([Date], "YYYYMM"))
1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Anonymous Here you go...

 

TestDimDate = 
ADDCOLUMNS (
    CALENDAR ( "01-01-2010", "31-12-2030"),
    "Year", YEAR ( [Date] ),
    "Quarter", CONCATENATE ( "Q", ROUNDUP ( MONTH ( [Date] ) / 3, 0 )),
    "Quarter&Year", CONCATENATE(CONCATENATE ( CONCATENATE ( "Q", ROUNDUP ( MONTH ( [Date] ) / 3, 0 )), " "),YEAR([Date])),    
    "Month", MONTH ( [Date] ),
    "SortMonthName", FORMAT ( [Date], "MMM" ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "Weekday", WEEKDAY ( [Date] )- 1,
    "DayInWeek",WEEKDAY([Date],2),
    "WeekEnding",([Date]+7)-WEEKDAY([Date],2),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "Mth&Yr", FORMAT ([Date], "MMMM YYYY"),   
    "SortMonth&Year", FORMAT([Date], "MMM" & " " & "YY"),
    "Sort", FORMAT([Date], "YYYYMM"))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@Anonymous Here you go...

 

TestDimDate = 
ADDCOLUMNS (
    CALENDAR ( "01-01-2010", "31-12-2030"),
    "Year", YEAR ( [Date] ),
    "Quarter", CONCATENATE ( "Q", ROUNDUP ( MONTH ( [Date] ) / 3, 0 )),
    "Quarter&Year", CONCATENATE(CONCATENATE ( CONCATENATE ( "Q", ROUNDUP ( MONTH ( [Date] ) / 3, 0 )), " "),YEAR([Date])),    
    "Month", MONTH ( [Date] ),
    "SortMonthName", FORMAT ( [Date], "MMM" ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "Weekday", WEEKDAY ( [Date] )- 1,
    "DayInWeek",WEEKDAY([Date],2),
    "WeekEnding",([Date]+7)-WEEKDAY([Date],2),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "Mth&Yr", FORMAT ([Date], "MMMM YYYY"),   
    "SortMonth&Year", FORMAT([Date], "MMM" & " " & "YY"),
    "Sort", FORMAT([Date], "YYYYMM"))

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Thank you so much for the solution! I work for Gradesfixer and I'm only one person, who know something in this field. So, this is great that I can find solutions on various forums!

Anonymous
Not applicable

Many Thanks, I see what i was trying to do...but it was wrong on my end. thanks

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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