AND OR logical test in power query RRS feed

  • Question

  • How do I write a logical test in the power query editor using AND and OR commands?

    I looked at this page: where it suggests to use double ampersand (&&) where following example is supposed to generate TRUE or FALSE: ([Region] = "France") && ([BikeBuyer] = "yes"))

     I assume that there is an error in the example. I expect one more left parentheses in the start. There's a similar example for OR command and that example has the extra parenthesis. But I don't think that's the problem. My problem is that I get error messages if I write double ampersands in the query.

    I made an example in my file with one column called "Region" that contains "France" and one column called "BikeBuyer" that contains "yes". Finally I add a new column where i write following formula (([Region] = "France") && ([BikeBuyer] = "yes")) and expect the result to be TRUE or FALSE. The power query editor won't accept the formula and complains of the two ampersands. 

    Can someone help me to get the AND command right?


    Friday, March 3, 2017 1:18 PM


All replies

  • Power Query uses "M" programming language.
    PowerPivot uses "DAX".
    Your link points to a DAX library.
    For Power Query operators see:

    Better yet, get the book:
    "M is for Data Monkey" by Ken Puls.

    Friday, March 3, 2017 9:37 PM
  • Hello Peter,

    Thanks for posting here, this forum is used for discussing development issues about Excel Object Model. Since your issue is related to Power Query, I would move this thread into Power Query forum.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, March 6, 2017 2:22 AM
  • In Power Query the keyword for AND is the lowercase: and

    [Region] = "France" and [BikeBuyer] = "yes"

    Monday, March 6, 2017 4:31 AM