Power BI is a popular reporting tool. One of the reasons is that in Power BI you can get data from different sources, and there is an increased interest of our customers and Anaplan builders to be able to import data from Anaplan. In order to make this connection, we developed a solution to set up the integration.
It is possible to have this integration between Anaplan and Power BI using Anaplan Rest APIs. Anaplan released two versions of Rest APIs — 1.3 and 2.0. For version 1.3, the authentication to Anaplan can be done using user and password (basic authentication).
For the Anaplan Rest API version 2.0, the authentication can be done only using a token authenticated, so if version 2.0 will be used, then a token string should be created and should be passed on the actions.
Kindly follow the below process:
In the next instructions, we will see how to create the token from a CA Certificate and authenticate into Anaplan in a single Power BI query. The whole code will be explained in this article.
Basic authentication can be used for this as well, however, please keep in mind the need to encode it first (password can be easily encrypted via the following link base64encode with the format email: password).
Fill with this information:
Add 3 headers:
Paste at the end of the code the Web.Contents, changing the version from 1/3 to 2/0 and the Authorization with the Token variable.
Paste the TransformColumnTypes without changes.
Finally, the response of the code will be #”Changed Type”. This is the content of your file:
As you can see, I added the function InvokeAfter. This is to give time to Anaplan to finish the export, and then we can continue with the download. I set this up with 20 seconds. Adjust this delay time depending on the size of your file.
A final recommendation: if you have a large file, it is better to split the Export over multiple actions because a large file can take a long time to be uploaded into Power BI, and use Chunks will create wrong rows in the concatenation of each one.