IF and AND in Dax

Excel Fox

New Member
Joined
Nov 18, 2020
Messages
9
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi I'm pretty new to Power Bi. I have 2 columns with Y and N in them. if Y appears in both for the same entry I want to return a Y, if not a N.

In excel it would be a simple if and and statement. DAX is confusing me at present!

Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
It's the same in DAX:

Excel Formula:
=if(and([Field1]="Y",[Field2]="Y"),"Y","N")
 
Upvote 0
Thanks for this.

I know have issue. I have column which is calculating between dates and returning the number of months. I need to now create a column that will return a "Yes" if the number of months is 4 or below.

I've tried IF, IF(AND and CALCULATE with DISTINCT COUNT.

Any ideas?

Thanks
 
Upvote 0
All you need is IF.

=if([field name]<4,"Yes","No")
 
Upvote 0
Will this count zeros and blanks as zero's?
As that is the problem I'm having.
 
Upvote 0
What do you want it to count blanks as?
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,044
Members
452,542
Latest member
Bricklin

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