Forum Discussion
Api call dynamic date determine by the user
In theory yes, it might be possible - in practice no, you aren't going to be able to do this in any useable way. In order to do what you're describing here you'd need to have a DirectQuery dataset where the source is your REST API and that's what Power BI doesn't support: https://blog.crossjoin.co.uk/2021/04/25/can-i-build-a-power-bi-directquery-dataset-on-top-of-a-rest-api/
Where does your REST API get its data from? The best thing to do is create an Import mode dataset to load all the data you need from that source. If that's not possible you could use your REST API as the source for the Import mode dataset, making as many calls as you need to load all the data that might ever need to be displayed in a report.
Hello cpwebb
Thank you for your reply.
I must have a table based on the selection calendar because if I request all my API I will have data day by day.
Exemple :
| Date | visits | Bounce rate |
| 01/01/2023 | 1000 | 0,5 |
| 02/01/2023 | 5000 | 0,3 |
| ... | ... | ... |
| 11/07/2023 | 1300 | 0,4 |
It's not a problem if I create a measure to calculate "visits" column but my calcul will be wrong if I apply a measure on bounce rate column because the result of API is already an average. If I create a measure I will apply an average to another average :s
It's the reason why I must refresh my api call based on the user selection period.
Thank you 🙂
- cpwebb3 years ago
Microsoft Employee
OK, well as I said you won't be able to do this with Power BI - your only option will be to get the raw data and recreate all the calculations in a measure.