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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
NikkiG12
Frequent Visitor

Formula with Conditions

I hope this is the right place for this, but looking for some help in what I am doing wrong. I want to add a column where it will output if a purchase is Eligible/Not Eligible based on specific criteria within my data table and I keep running into errors. 

Eligibility criteria:
Date falls between Sept 1, 2023 and October 31, 2023
Product ID is 8598
Purchase Country is Canada
Purchase Name is not OP

EligibleColumn = IF(
    AND(
        'Table 1' [Date] >= DATE(2023,09,01),
        'Table 1 '[Date] <= DATE (2023,10,31),
        'Table 1 '[ID] = "8598",
        'Table 1'[Country] = "Canada",
        NOT('Table 1'[Name] = "OP"),
  )
    "Eligible",
    "Not Eligible"
)  


Any ideas what I am doing wrong?

2 REPLIES 2
tackytechtom
Most Valuable Professional
Most Valuable Professional

Hi @NikkiG12 ,

 

The syntax looks like you used DAX, but you posted this in the Power Query forum, so I believe you actually are interested in a solution in M:

tackytechtom_0-1701119486403.png

 

Here the code in M:

if [Date] >= #date(2023,9,1) and
   [Date] <= #date(2023,10,31) and
   [ID] = 8598 and 
   [Country] = "Canada" and
   [Name] <> "OP" then "Eligible" else "Not Eligible"

 

Let me know if this solves your issue 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Thank you, I'll give this a try

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.