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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.