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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lmpb1988
Frequent Visitor

Update week number automatically

Hi

 

In power bi I have a data segmentation visual based on the week number, which in turn takes the week number information from a calendar table.
The filter is working correctly but I would like to know if there is a way when I open the powerbi file that the week number can be updated automatically and not manually.
For example, I can set the filter between week 1 and week 52 (last week of the year) and all the data will appear, but I would like it to calculate the current week automatically and not have it inputted automatically. manually.

For example, at this moment, when I open the file I have, the filter is from week 1 to week 21, according to the image I added, and I can only change this if I do it manually.

 

Thanks

 

numweeked.jpg

1 ACCEPTED SOLUTION

Apply the Filter to Your Visual:

Go to the visual where you want to apply the filter.
Drag the IsCurrentWeek measure to the Filters pane.
Set the filter to show only items where IsCurrentWeek is TRUE.




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

4 REPLIES 4
lmpb1988
Frequent Visitor

Tks, that works.

lmpb1988
Frequent Visitor

But a measure can't be added to a field right?

 

numweeked.jpg

Apply the Filter to Your Visual:

Go to the visual where you want to apply the filter.
Drag the IsCurrentWeek measure to the Filters pane.
Set the filter to show only items where IsCurrentWeek is TRUE.




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

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

@lmpb1988 , For this you can create a measure first make sure you have a date table with week number

 

Calendar =
ADDCOLUMNS (
CALENDAR (DATE(2023, 1, 1), DATE(2023, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Week Number", WEEKNUM([Date], 2) -- 2 indicates that the week starts on Monday
)

 

Then create a new column in this date table to calculate current week

CurrentWeek =
IF (
YEAR(TODAY()) = [Year],
WEEKNUM(TODAY(), 2),
BLANK()
)

 

Then create a measure for current week

CurrentWeekMeasure = WEEKNUM(TODAY(), 2)

 

Use this instead of Numweeked




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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.