Forum Discussion
bnisbet
8 years agoFrequent Visitor
IF Statement &&&&
Trying to use an IF Statement to calculate if a date is in the current month.
When I take out "&&" it works fine, any ideas?
Audit In Current Month =
IF (
YEAR ( 'Power BI List'[Visit 1 Date] ) = YEAR ( TODAY () )
&& MONTH ( 'Power BI List'[Visit 1 Date] ) = MONTH ( TODAY () ),
"1",
"0"
)Thanks!
:)
Hi bnisbet,
What error did you get?
Based on my test, the formula you provided above should work. :smileyhappy:
Regards
2 Replies
- AnonymousNot applicable
By the way, why you don't use IF AND?
Try this:
Audit In Current Month = IF ( AND ( YEAR ('Power BI List'[Visit 1 Date] ) = YEAR ( NOW() ), MONTH ('Power BI List'[Visit 1 Date] ) = MONTH ( NOW() ) ), "1", "0" ) - v-ljerr-msftMicrosoft Employee
Hi bnisbet,
What error did you get?
Based on my test, the formula you provided above should work. :smileyhappy:
Regards