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 September 15. Request your voucher.

Reply
PaulF0901
Regular Visitor

Displaying 'week commencing' date instead of week number

Hello,

 

I was wondering if anyone might be able to help. 

I am currently showing activities by week number in a PBI report. I now need to modify the report so that the x axis shows the 'week commencing' date instead of the week number. Does anyone know how I might do that?

 

Here's my current model view:

PaulF0901_0-1720004257933.png

 

Right now I count up how many activities (by activityID) exist for a user (user email) and then display it on a bar chart. I then use WEEKNUM on the X axis. 

 

Can anyone advise how to replace WEEKNUM with week commencing?

 

Many thanks

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

To display a blank bar for weeks with no activity in your Power BI chart, you need to ensure that all weeks are represented in your data, even if there is no activity for some weeks. This can be achieved by creating a separate date table that includes all the weeks you want to display and then creating a relationship between this date table and your activity data. Pull column from that table and Click on the X-axis field in the visualization pane.
Check the option Show items with no data.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

7 REPLIES 7
bhanu_gautam
Super User
Super User

To display a blank bar for weeks with no activity in your Power BI chart, you need to ensure that all weeks are represented in your data, even if there is no activity for some weeks. This can be achieved by creating a separate date table that includes all the weeks you want to display and then creating a relationship between this date table and your activity data. Pull column from that table and Click on the X-axis field in the visualization pane.
Check the option Show items with no data.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Ah, I've just figured out why the bar is not showing in the barchart. There are entries for the missing time period (May 13th) but those entries are filtered out by the filters on the visual 🙄

So I need to work out how on earth I can filter out rows but still have those rows show as blanks! 

You can create a measure and filter out those values using filter in measure then there will be no requirment to use Filter on visual




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks. You make it sound so easy 😄 

I'll go and figure out what a measure is. 

@PaulF0901 , Can you accept this as solution as it helps in the original query you posted and if you need help in creating a measure you can post a new post for that




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






PaulF0901
Regular Visitor

Hi, this is wonderful, thank you. 

Just one more follow up question if I may. I have swapped WEEKNUM for WeekCommencing and it looks good. The only trouble is, I no longer have the empty columns (some weeks there is no activity). Any idea how to solve this? 
I have pasted a screenshot below. The second chart has less bars on it due to the face that there was no workspace creation activity in the week beginning the 13th. Any idea how I might just get it to display a blank bar? I had thought about checking 'Show items with no data' on the WeekCommencing field in the x axis but all that does is give me what you can see in the second screenshot. 

 

ss1

PaulF0901_0-1720082688798.png

SS2

PaulF0901_1-1720082725838.png

 

Thanks again for helping. 

 

bhanu_gautam
Super User
Super User

@PaulF0901 , For this you need to have weekcomencing column in your datetable

DateTable =
ADDCOLUMNS (
CALENDAR (DATE(2020, 1, 1), DATE(2030, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"WeekNumber", WEEKNUM([Date]),
"WeekCommencing", [Date] - WEEKDAY([Date], 2) + 1
)

 

Currently it calculates monday and replace weekcommencing with weeknum in your visual

 

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.