Help with DAX

Guttmann1983

Board Regular
Joined
Jul 27, 2015
Messages
181
[FONT=&quot]Hi, I am trying to figure out where I am going wrong with the below DAX Expression [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]=IF(AND(YEAR([Demand Sent]=YEAR(TODAY())),WEEKNUM([Demand Sent]=WEEKNUM(TODAY())),FORMAT([Demand Sent],"ddd"),""))[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot][Demand Sent] is a field that is either a date, or is blank. I am trying to get the dax expression to return "Mon" or "Tue" or "Wed" etc. if the date in this field is from the current week (Monday - Sunday) or return blank if its not. the last peice, FORMAT([Demand Sent],"ddd"),"")) is giving me problems.[/FONT]
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Guttmann1983

It appears parenthesis were left open in the first parameter of YEAR & WEEKNUM functions.

=
IF (
AND (
YEAR ( [Demand Sent] ) = YEAR ( TODAY () ),
WEEKNUM ( [Demand Sent] ) = WEEKNUM ( TODAY () )
),
FORMAT ( [Demand Sent], "ddd" ),
""
)

Here is the result I got in calc column:

<table verdana,="" arial,="" tahoma,="" calibri,="" geneva,="" sans-serif;"="" width=""><tbody>[TR]
[TH]Demand Sent[/TH]
[TH]Calculated Column 1[/TH]
[/TR]
[TR]
[TD]11/12/2016[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11/24/2016[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12/6/2016[/TD]
[TD]Tue[/TD]
[/TR]
[TR]
[TD]12/18/2016[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12/30/2016[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/11/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/23/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/4/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/16/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2/28/2017[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/12/2017[/TD]
[TD][/TD]
[/TR]
</tbody></table>


Thanks, Nick -
 
Upvote 0
Sorry for the HTML tags ...

Here is the result I got:

Demand Sent Calculated Column 1
11/12/2016
11/24/2016
12/6/2016 Tue
12/18/2016
12/30/2016
1/11/2017
1/23/2017
2/4/2017
2/16/2017
2/28/2017
3/12/2017
 
Upvote 0
when I use the below


=
IF (
AND (
YEAR ( [Demand Sent] ) = YEAR ( TODAY () ),
WEEKNUM ( [Demand Sent] ) = WEEKNUM ( TODAY () )
),
FORMAT ( [Demand Sent], "ddd" ),
""
)

the "ddd" and "" from the part "ddd" ), "") are in red
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top