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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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