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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jytech
Helper I
Helper I

FORMAT DAX WEEKNUM

Hello,

 

I created a Calendar Table using DAX. I currently have a Column with the Week Number with DAX written as: Week Number = WEEKNUM('Date'[Date],1). Instead of simply showing just the Week Number (i.e. 1,2,3,4...53), I would like to format it to only show "MM/YYYY" (i.e. 01/2020). Is there a way to format the WEEKNUM DAX Date Function to only show "MM/YYYY" only while not showing the actual Week Number?

4 REPLIES 4
vivran22
Community Champion
Community Champion

Hello @jytech ,

 

You can use the FORMAT function

 

"WekNum", FORMAT([Date],"MM/YYYY")
 
weeknum.png
Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Hi Vivek,

 

Thanks for your feedback but that FORMAT function does one of two things:

  1. If I use this FORMAT([Date],"MM/YYYY"), it groups it by month which does not give me the Week Hierarchy that I need.
  2. If I use it like this FORMAT(WEEKNUM([Date],1),"MM/YYYY"), it gives me a year of "1900"

Right now, this works:

"(" & "Week " & 1 + WEEKNUM('Date'[Date]) - WEEKNUM(STARTOFMONTH('Date'[Date])) & ") " & FORMAT('Date'[Date], "MM") & "/" & FORMAT('Date'[Date], "YYYY") and it gives me "(Week 1) 01/2018" but I can't seem to remove the "Week 1" from the output.
vivran22
Community Champion
Community Champion

@jytech 

 

Can you share few sample output you are looking for? That would help me in understanding the requirement better.

 

Cheers!
Vivek

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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