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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
cnederveen
New Member

issues with defender API calls in Power Query (odata)

In Power Query:

 

Why does the first query work and the second query does not? If the field types are integer or Boolean the filter fails. Why?

 

Query 1 (works) :

 

Query = "Vulnerabilities?$filter=severity eq 'Critical' and cvssV3 eq 9.8",

 

Source = OData.Feed(https://api.securitycenter.microsoft.com/api/ & Query, null, [Implementation="2.0", MoreColumns=true])

 

Query 2 (fails) :

 

Query = "Vulnerabilities?$filter=severity eq 'Critical' and exposedMachines gt 0",

 

Source = OData.Feed(https://api.securitycenter.microsoft.com/api/ & Query, null, [Implementation="2.0", MoreColumns=true])

 

 

cnederveen_0-1629455773099.png

 

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @cnederveen ,

The field type applied to the filter can be a number, datetime, or string and the type used must match the type set in the dataset. However, Boolean type is not included in them. Could you please change Query 2 to the following form: equal to a fixed value already in the dataset and check if it works after updated?

Query = "Vulnerabilities?$filter=severity eq 'Critical' and exposedMachines eq [static value]",

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
Super User
Super User

Is exposedMachines an actual column in your source data or are you trying to run an aggregation of sorts?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.