The following videos demonstrates how to get WATS data and presentation in Power BI:
Power BI using WATS rest API and GET requests
Power BI using WATS rest API - POST requests
See also:
How-to create a WATS data source in Power BI desktop.
- Click Get data -> Blank query
- Right click and select Advanced editor
- Past the following into the editor to create POST request with a wats filter payload in the request body. The example creates a request to the App/DynamicYield endpoint with instructions to get the yield by period and product over the last 6 months. Remember to replace the url and token with your own data.
let
Source = Json.Document(Web.Contents("https://virinco.wats.com",
[
RelativePath="/api/App/DynamicYield?dimensions=period desc;partNumber;productName",
Content=Text.ToBinary("{
'topCount':1000,
'periodCount':6,
'dateGrouping':3,
'includeCurrentPeriod':true
}"),
Headers=[Authorization="Basic " & "TOKEN" & "",#"Content-Type"="application/json"]
])),
CheckEmpty = if List.IsEmpty(Source) then Json.Document("[{}]" ) else Source
in Source
- Click the "To Table" button and "expand columns" to convert the result to a tabular format.
- You should now have your data in a tabular format, and the option to manipulate the results further, ie. change datatype, hide columns etc.
Comments
0 comments
Please sign in to leave a comment.