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

Current week/year true or false

I have a column in my data called 'week of' and it displays the date for the Monday of that week. For example, this week the date listed is November 7, 2022.

 

I want to create a new column that provides a true or false value, based on whether the date showing in the week of column is the current week and year.

 

For example: It would show true for the line item with November 7, 2022, in the week of column, but false for November 14, 2022. 

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi @Anonymous , try this calculate column:

Result = 
var _year= YEAR(Table_example[Date])
var _week=WEEKNUM(Table_example[Date])
var actual_week=WEEKNUM(TODAY())
var actual_year= YEAR(today())
return 
IF(_year=actual_year && _week=actual_week,"True","False")

- The result:

Bifinity_75_0-1667941036707.png

 

Best regards

 

View solution in original post

1 REPLY 1
Bifinity_75
Solution Sage
Solution Sage

Hi @Anonymous , try this calculate column:

Result = 
var _year= YEAR(Table_example[Date])
var _week=WEEKNUM(Table_example[Date])
var actual_week=WEEKNUM(TODAY())
var actual_year= YEAR(today())
return 
IF(_year=actual_year && _week=actual_week,"True","False")

- The result:

Bifinity_75_0-1667941036707.png

 

Best regards

 

Helpful resources

Announcements
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.