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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mrrobottelg
Frequent Visitor

Need help with DAX Formula to get Month and Week number of current month

Hi,

Need help with DAX Formula to get Month and Week number of current month.

 

Sample table

 

DateMonth NameDayWeekYear
6/29/2024JunSatWK52024
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @mrrobottelg - Using calculated colum we can achieve this, extract the month name and the week number of the current month from a date column as below by creating two calculated columns for month and week

 

Month Name calculated column:

your date table.

 

Month Name = FORMAT('YourTable'[Date], "MMM")

 

Month No calculated column: 

Month No= Month ( YourTable[Date])

 

Weekin month calculated column:

 

Week In Month =
VAR FirstOfMonth = DATE(YEAR('YourTable'[Date]), MONTH('YourTable'[Date]), 1)
VAR WeekOfYear = WEEKNUM('YourTable'[Date])
VAR WeekOfMonth = WEEKNUM('YourTable'[Date]) - WEEKNUM(FirstOfMonth) + 1
RETURN
"WK" & WeekOfMonth

 

It works. Please check and replace with your date table instead of YourTable.

 

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
mrrobottelg
Frequent Visitor

Ok.

This also helps. Thank you.

 

mrrobottelg
Frequent Visitor

Hi Ranjendra Garu,

 

I want Auto generated seperate table for everymonth.

Hi @mrrobottelg -Power BI does not support dynamic table creation in the DAX model as a seperate tables for each month.

you can try to create the same in Power query editor if you have a date table, by using custom functions.

Hope it helps you.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





rajendraongole1
Super User
Super User

Hi @mrrobottelg - Using calculated colum we can achieve this, extract the month name and the week number of the current month from a date column as below by creating two calculated columns for month and week

 

Month Name calculated column:

your date table.

 

Month Name = FORMAT('YourTable'[Date], "MMM")

 

Month No calculated column: 

Month No= Month ( YourTable[Date])

 

Weekin month calculated column:

 

Week In Month =
VAR FirstOfMonth = DATE(YEAR('YourTable'[Date]), MONTH('YourTable'[Date]), 1)
VAR WeekOfYear = WEEKNUM('YourTable'[Date])
VAR WeekOfMonth = WEEKNUM('YourTable'[Date]) - WEEKNUM(FirstOfMonth) + 1
RETURN
"WK" & WeekOfMonth

 

It works. Please check and replace with your date table instead of YourTable.

 

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





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.

Top Solution Authors