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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dinomaster
Frequent Visitor

IF AND dax Formula

Hey,

 

So I'm trying to add a column to filter the current month of the year. So far I've only been able to filter out the current month.

 

deletePresentMonth = if(value(Date[Month]) = MONTH(today());true;false)

 

What/How should I add another rule for the current year?

 

Thanks!

1 ACCEPTED SOLUTION
ovetteabejuela
Impactful Individual
Impactful Individual

Simply do an AND or &&, I usually use &&

 

State of Month = IF(YEAR(community[Date])=year(NOW()) && MONTH(community[Date]) = MONTH(NOW()),"Current Month","Previous Month")

 

hope this helps

View solution in original post

4 REPLIES 4
pinkdino99
New Member

Hi.

So I have ;

tbl One - Column This (either 1 or 2) - Column That (either A or B)

I want a new column Then where This = 2 AND That = B marked "YES"

 

THEN = IF('tbl One'[THIS] = "2")&& IF('tbl One'[That] = "B", "YES")

 

And it doesn't work...

Too few arguments were passed to the AND function. The minimum argument count for the function is 2.

 

Any DAX Jedi in the house ?

I know this is a bit late...

But the arguments error came up because you did not present an alternate to the "YES" true if statement.

 

Here is what I would change...

 

THEN = IF('tbl One'[THIS] = "2")&& IF('tbl One'[That] = "B", "YES", "NO")

ovetteabejuela
Impactful Individual
Impactful Individual

Simply do an AND or &&, I usually use &&

 

State of Month = IF(YEAR(community[Date])=year(NOW()) && MONTH(community[Date]) = MONTH(NOW()),"Current Month","Previous Month")

 

hope this helps

Perfect @ovetteabejuela,

 

Thank you a lot Smiley Wink

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.