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

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.

Reply
craig811
Helper III
Helper III

M-Query GETDATA - Filter

Hi ,

 

Currently my query is grabing all the data from the sever, however I need to just pull the data by 'Plant', Is there a way to filter the data at the GETDATA function so it ony pulls the records by 'PLANT' ?

 

Current function:

GetData = Json.Document(Web.Contents(url & "rawdata/responses" & "?tenant=" & tenant,
[
Timeout=#duration(0, 0, 10, 0),
Headers=[Authorization="test" & access_token, #"content-type" = "application/json:charset = utf-5"],
Content=Text.ToBinary(body)
])),

 

TotalPages = GetData[TotalPages],
ListNumbers = List.Numbers(1,TotalPages,1),

 

I need a filter added to above to pull the data by 'Plant' name , which is a column name within the body of  each page.

 

Many thanks

1 ACCEPTED SOLUTION
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @craig811 - it might be possible but it will depend on the API provider.  You will need to look at the API instructions to determine how the filter can be included in the "body".  If is possible, try using another tool like Postman or VS Code to test the syntax required by API.  This can then be replicated in this in your M code.

View solution in original post

1 REPLY 1
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @craig811 - it might be possible but it will depend on the API provider.  You will need to look at the API instructions to determine how the filter can be included in the "body".  If is possible, try using another tool like Postman or VS Code to test the syntax required by API.  This can then be replicated in this in your M code.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors