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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
scolino
Frequent Visitor

DAX:Expression in Boolean

I am trying to calculate as sum of the WeeklyPlan column with only data that has a year of 2017 and a specified week num. Below is the formula I am using:

 

LastWeekPlan = CALCULATE(sum('Weekly'[Weekly Plan]),Weekly[Year]=2017,Weekly[WeekNum]=(WEEKNUM(2/13/2017,1)))

 

The formula works if I add a stagnant number in the Weekly[WeekNum]=... boolean, but when I add the WEEKNUM expression, the formula doesn not work.  I will eventually be replacing the date with today() expression.

 

Any ideas why my logic will not work?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Use WEEKNUM(DATE(2017,2,13),1)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

@scolino

 

Hi,

 

Could you please tell me if your problem is solved? You can mark the right answer to help others if it's convenient for you.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Use WEEKNUM(DATE(2017,2,13),1)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.