- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use "IN" operator in power Query
Hi All,
Am new to Power BI and MSQL
I have a power query to import data from Microsoft Services where in i am currently using "OR" operator (Max 2) data values under a column to be checked while importing.
But my query should import data from service when this column is checked more than 2 values like FY 2015, FY 2016--- FY 2019.
Current PQuery:
EVALUATE
CALCULATETABLE (
ADDCOLUMNS (
"NPS Passive Count", 'NPS'[NPS Passive Count],
"NPS Advocate Count", 'NPS'[NPS Advocate Count],
"NPS Detractor Count", 'NPS'[NPS Detractor Count]
)
,OR ('Survey Response Date'[Financial Year] = "FY 2018" ,'Survey Response Date'[Financial Year] = "FY 2019")
)
Could you please help me with this at the earliest?
Thanks:
Nishanth
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not Power Query, it's a DAX query. "Power Query" (also known by it's codename of "M") is the term given to the language used by the queries when you click on the "Get Data" button in Power BI.
To use the IN operator in DAX you would do the following:
EVALUATE
CALCULATETABLE (
ADDCOLUMNS (
"NPS Passive Count", 'NPS'[NPS Passive Count],
"NPS Advocate Count", 'NPS'[NPS Advocate Count],
"NPS Detractor Count", 'NPS'[NPS Detractor Count]
)
,'Survey Response Date'[Financial Year] IN { "FY 2018", "FY 2019"} )
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi nmaheshwarappa,
You can multiple ORs in your logical condition.
Like,
OR('Survey Response Date'[Financial Year] = "FY 2016",(OR('Survey Response Date'[Financial Year] = "FY 2017",OR ('Survey Response Date'[Financial Year] = "FY 2018" ,'Survey Response Date'[Financial Year] = "FY 2019"))))
Regards,
Pradeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not Power Query, it's a DAX query. "Power Query" (also known by it's codename of "M") is the term given to the language used by the queries when you click on the "Get Data" button in Power BI.
To use the IN operator in DAX you would do the following:
EVALUATE
CALCULATETABLE (
ADDCOLUMNS (
"NPS Passive Count", 'NPS'[NPS Passive Count],
"NPS Advocate Count", 'NPS'[NPS Advocate Count],
"NPS Detractor Count", 'NPS'[NPS Detractor Count]
)
,'Survey Response Date'[Financial Year] IN { "FY 2018", "FY 2019"} )
)
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
Anonymous
| 03-21-2024 08:15 AM | ||
07-07-2024 09:13 PM | |||
06-05-2024 09:41 AM | |||
03-27-2024 11:43 PM | |||
08-07-2024 10:22 AM |
User | Count |
---|---|
123 | |
80 | |
59 | |
58 | |
44 |
User | Count |
---|---|
182 | |
119 | |
82 | |
68 | |
53 |