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
Madunapa
New Member

Multiple API Calls into on table

Hey I have an issue with a project. We have platform for monitoring customers which they consume different licenses. For billing we need to pull out that data every month. That consist of pulling data from 7 different API's pr customer. The job is to consolidate all data 7 Calls x 300ish customers into one readable report to do billing. Columns: Customer, Month, Licenses Consumed. Some months a customer might not have consumed licenses from one or more of the API's which results in NULL and a different format of the tabel, which makes the consolidation troublesome as this is not consistant. 

 

Any ideas on how to approach this problem? I want to make a template for each call, making it easy to add all the different calls into power bi for all customers. 

 

Is it possible to do an IF in the advnaced editor with two different outcomes? E.g IF no data: (make "this let&in" table with 0 and the current month, instead of just NULL) ELSE make: "this let&in".

 

Or even better: is there a way to add all the calls into one query? Or 7 different queries with query 1 having all the api calls for license 1 and query 2 with all the calls for license 2 and so on...

 

I've read up on the community on this and there are some similar issues but it does'nt work especcially due to no data on some of the calls.

 

I'm really strugling here and i'm new to power BI. Let me know if there's any information i might add! Any help is much appriciated!

2 REPLIES 2
mahoneypat
Employee
Employee

Not sure how similar the data/tables returned from your 7 different API calls, but this video should help with how to start with a table of values (customers and/or APIs) and concatenate them into a url in a Web.Contents call, and combine them.

Power BI - Tales From The Front - REST APIs - YouTube

 

For those that return no rows (your nulls), you can make a dummy table with #table( ) in a separate query (that has 0 values in your desired fields).  Prior to expanding the tables returned by the web calls, you can add an if Table.RowCount([ColumnWithTables])>0 then [ColumnWithTables] else dummytable, and then expand that new column of tables to get your desired result.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Great video! Is it possible to share a link to the PowerBI file demonstrated in the video? 

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