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.
Hi all,
I'm trying to pull data to Power BI desktop using the following query:
SELECT * FROM SA_SHP_HST_HDR WHERE 'CUS_PRC_CLS' in ('xxx1',
'xxx2',
'xx3')
When I run the query it won't bring any results, the table is blank (with no errors). But if I pull the whole table, use the filter row function and apply the exactly same filters it will bring the results that I need. The thing is I have a list of codes that I would like to filter and to add them one by one to the filter function it's not the most efficient way.
I was wondering if something is wrong with my query or if the "WHERE" clause is not supported in the advanced options?
Appreciate your help!
Thanks
Mariana
Solved! Go to Solution.
@marianamarques, Did you try running in other environment and get any result? (excel, sql server management, etc..)
Try not to put '' in your column name.
Try this:
SELECT * FROM SA_SHP_HST_HDR WHERE CUS_PRC_CLS in ('xxx1', 'xxx2', 'xx3')
Or try this:
SELECT * FROM SA_SHP_HST_HDR WHERE CUS_PRC_CLS = 'xxx1' or CUS_PRC_CLS = 'xxx2' or CUS_PRC_CLS = 'xxx3'
I suppose that CUS_PRC_CLS is your column, and xxx1,xxx2,xxx3 are the values.
@marianamarques, Did you try running in other environment and get any result? (excel, sql server management, etc..)
Try not to put '' in your column name.
Try this:
SELECT * FROM SA_SHP_HST_HDR WHERE CUS_PRC_CLS in ('xxx1', 'xxx2', 'xx3')
Or try this:
SELECT * FROM SA_SHP_HST_HDR WHERE CUS_PRC_CLS = 'xxx1' or CUS_PRC_CLS = 'xxx2' or CUS_PRC_CLS = 'xxx3'
I suppose that CUS_PRC_CLS is your column, and xxx1,xxx2,xxx3 are the values.
@Anonymous Thank you! It worked without the ''!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |