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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
CarlsBerg999
Helper V
Helper V

Calculated column to measure

Hi, 

 

I managed to create what i want as a calculated column, but im lost on why this doesnt work as a measure:

 

Current Week =
IF(
AND(DateTable[WeekNumber] = WEEKNUM(TODAY())-1,
DateTable[Year]=YEAR(TODAY())),
TRUE, FALSE)
 
How do i turn the DAX above to a measure and why doesnt IF work in measures?
 
Thanks for the help! 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@CarlsBerg999 , a measure will be like

 

Current Week =
IF(
AND(max(DateTable[WeekNumber]) = WEEKNUM(TODAY())-1,
max(DateTable[Year])=YEAR(TODAY())),
TRUE, FALSE)

 

 

refer in case you are looking for WOW

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@CarlsBerg999 , a measure will be like

 

Current Week =
IF(
AND(max(DateTable[WeekNumber]) = WEEKNUM(TODAY())-1,
max(DateTable[Year])=YEAR(TODAY())),
TRUE, FALSE)

 

 

refer in case you are looking for WOW

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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