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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PJOS_1
Frequent Visitor

OR operator inside API filter

Hi all, I've scoured the web and the forums and I can't quite figure out how the syntax of this should be written. I keep getting an error. 

 

Quite simply, I'm trying to connect Power BI to the federal government's CMS data. I can filter the data just fine with a very basic filter. For example, this works fine: 

 

"Source = Json.Document(Web.Contents("https://data.cms.gov/data-api/v1/dataset/0a33dac8-73b2-4223-83e7-d709645c3549/data?filter[PROVNUM]=1..."))"

 

What I really want to do is have data for: [PROVNUM]=115404 OR [PROVNUM] = 115376. 

 

I'm a noob at this and I've tried a million different ways. I can't seem to get the proper syntax right. I ultimately have a total of 20 PROVNUM values I'd like to daisy chain together into one table. I can call the whole table from the website but that's MASSIVE. I could write 20 queries and append it all but that's tedious and not very elegant. 

 

How can I do this? I've tried ||, OR, or, and everything in between trying to mimick other queries I've found to no avail. 

 

Thanks! 

 

 

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

According to the linked documentation, you can write it using an IN operator like this:

https://data.cms.gov/data-api/v1/dataset/0a33dac8-73b2-4223-83e7-d709645c3549/data
?filter[name-filter][condition][path]=PROVNUM
&filter[name-filter][condition][operator]=IN
&filter[name-filter][condition][value][1]=115404
&filter[name-filter][condition][value][2]=115376

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

According to the linked documentation, you can write it using an IN operator like this:

https://data.cms.gov/data-api/v1/dataset/0a33dac8-73b2-4223-83e7-d709645c3549/data
?filter[name-filter][condition][path]=PROVNUM
&filter[name-filter][condition][operator]=IN
&filter[name-filter][condition][value][1]=115404
&filter[name-filter][condition][value][2]=115376

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.