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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

DAX question for create a new column

Hi, 

I want create a column for my customer table, but my DAX did not work very well.

So I want my column can satisfy 3 condtions, ProductID is 1102, and Date belong to 2017, Also the version could be Ver 1 or Ver 3, then in my new column could be marked as Yes, but in my result, it missed one(Redline marked)

I want to know the correct DAX to satisfy my condition. 

Thank you!

Inked3231231_LI.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

Below is an example of what you are trying to achieve

 

Confirm = IF(AND('Table'[ProductID] = 1102, AND('Table'[Date].[Year] = 2017, OR('Table'[Version] = "Ver 1", 'Table'[Version] = "Ver 2"))), "Yes", "")

Capture.PNG

View solution in original post

4 REPLIES 4
jherralo95
Frequent Visitor

Try with:

 

Confirm = IF(AND(Customer[ProductId]="1102";YEAR(Customer[Date])=2017;OR(Customer[Version]="Ver 1";Customer[Version]="Ver 3"));"Yes";"")
Anonymous
Not applicable

Hi @Anonymous 

 

As you have 3 conditions, you will need to use nested AND statements e.g. if(AND(condition 1, AND(condition 2, OR(Condition3, condition 4)))

 

Try that and let me know if it works. Alternatively if you could share the PBI file, it would be helpfull

Anonymous
Not applicable

Hi @Anonymous 

Below is an example of what you are trying to achieve

 

Confirm = IF(AND('Table'[ProductID] = 1102, AND('Table'[Date].[Year] = 2017, OR('Table'[Version] = "Ver 1", 'Table'[Version] = "Ver 2"))), "Yes", "")

Capture.PNG

Anonymous
Not applicable

Thank you !

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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