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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.