I am trying to import my YNAB data into PowerBI using the API. Could someone post detailed instructions for how to import my data into PowerBI?
Hi Tomato Wildcat ! The API was developed primarily for people who are familiar with API setups and coding, but we can definitely see what we can do to help.
The best place to start is our API Starter Kit, which may give you some resources.
On the side of PowerBI, it looks like this module should contain the information you need.
Let us know what you build!
You will need to generate an access token in the developer settings in your YNAB account (follow the instructions on the YNAB API page on how to do that).
Hopefully you are familiar with PowerBI. I used the good old trial and error method along with this handy YNAB API endpoint guide.
Use the get data "web" connector and switched to advanced. Enter the API URL in the URL parts. In the HTTP request header dropdown select "Authorization" and put "Bearer <token key>" (without quotes).
I haven't gotten too much further than importing all my transactions and plotting them, but I think the next steps would be to import the different classes (e.g. accounts, transactions, categories) and use the modelling tool (aka relationship builder) to map the unique classes to each other).
Here's the resulting powerquery syntax to get the transactions of the last used budget. You'll need to do some navigating afterward to get the data out into a table form.
Json.Document(Web.Contents("https://api.youneedabudget.com/" & "v1/budgets/" & "last-used/transactions", [Headers=[Accept="application/json", Authorization="Bearer <token key>"]]))
PS: Divide the "amount" column by 1000 if you're in USD.