Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
badluckmath
Frequent Visitor

HELP NEEDED: GETING DATA FROM API

I have to pull a data from a websource that provides a webAPI to downlood the data, here's a tamplate:

 

https://hq.appsflyer.com/export/com.greatapp/partners_report/v5?api_token=xxxx
&from=2018-04-09&to=2018-05-09&media_source=googleadwords_int

 

The problem is that, i need to insert a data range on this link, as you can see in the line "from=2018-04-09&to=2018-05-09".

This data will be used to make reports from a certain date up to today's date. But i need to do it without having to change the url everyday.

 

Is there any way of doing this using DAX?

 

Here is an example of a pull:

Sem título.png

 

i tried to put a formula that gives me the time formart i needed between the url like this :

"....from=2020-07-01&to="& FORMAT(TODAY(), "YYYY-MM-DD")&"&additional_fields=keyword_id,store_reinstall,...."

 

but it didn't worked.

Please, help!

3 REPLIES 3
amitchandak
Super User
Super User

@ImkeF , Can you help with this.

 

@badluckmath , @Anonymous , while imkef has a look at it. Refer if this can help, the "faking out" portion of the link -http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/

While this link might not be of great help...

Hi all,

as you're doing this in the query editor, you have to use the M-language (Power Query) and not DAX.

 

This is how to retrieve todays date formatted as text in the desired format:

 

Date.ToText ( Date.From ( DateTime.LocalNow() ) , "yyyy-MM-dd" )

 

If you want to refresh these queries in the Power BI service, you have to make further adjustments like mentioned in the article that @amitchandak has posted.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Anonymous
Not applicable

I have the exact same question.  So far I've not seen any solutions. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.