Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I have a date table where I have 2 columns, 1 for previous week and the same for the current week, where I get the true/false values. The DAX for the columns is as follows:
Previous Week =
IF ( ( WEEKNUM ( NOW (), 2 ) - 1 ) = Calendar[Week Number], TRUE, FALSE )
Current Week =
IF ( ( WEEKNUM ( NOW (), 2 ) - 0 ) = 'Calendar'[Week Number], TRUE, FALSE )
This works fine but I would however like that I have just 1 column, where I have the text "Current Week" and "Previous Week" for the appropriate weeks and then the week numbers in the rest of the column. I'm unsure how to do this though.
Could someone please advise me?
Thanks.
Solved! Go to Solution.
Like this.
Week =
VAR _DateWeek = [Date] - WEEKDAY ( [Date], 2 )
VAR _Today = TODAY()
VAR _ThisWeek = _Today - WEEKDAY( _Today, 2 )
VAR _LastWeek = _Today - WEEKDAY( _Today, 2 ) - 7
RETURN
SWITCH(
TRUE(),
_DateWeek = _ThisWeek, "Current Week",
_DateWeek = _LastWeek, "Last Week",
FORMAT( WEEKNUM([Date]), "#")
)
Like this.
Week =
VAR _DateWeek = [Date] - WEEKDAY ( [Date], 2 )
VAR _Today = TODAY()
VAR _ThisWeek = _Today - WEEKDAY( _Today, 2 )
VAR _LastWeek = _Today - WEEKDAY( _Today, 2 ) - 7
RETURN
SWITCH(
TRUE(),
_DateWeek = _ThisWeek, "Current Week",
_DateWeek = _LastWeek, "Last Week",
FORMAT( WEEKNUM([Date]), "#")
)
I think this will do what you are looking for.
Week Column =
VAR _DateWeek = [Date] - WEEKDAY ( [Date] )
VAR _Today = TODAY()
VAR _ThisWeek = _Today - WEEKDAY( _Today )
VAR _LastWeek = _Today - WEEKDAY( _Today ) - 7
RETURN
SWITCH(
TRUE(),
_DateWeek = _ThisWeek, "Current Week",
_DateWeek = _LastWeek, "Last Week",
FORMAT( WEEKNUM([Date]), "#")
)
Thank you, my week starts on Monday though. How do I change this?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |