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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ramiroferrando
Regular Visitor

Looping Get Data from multiple URLs (>100)

Hi, 

First of all, thanks in advance for taking the time to help.

I'm trying to automatically get data from multiple URLs (Variable "Link"). The only thing that changes among the URLs is the variable "Ticker".

 

1.png

What I'd like to do is to "Get Data" from all of these URLs and to apply the same steps.

 

Example for the 1st:

let
    Source = Csv.Document(Web.Contents("http://www.stockpup.com/data/AMR_quarterly_financial_data.csv"),[Delimiter=",", Columns=41, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Quarter end", type date}, {"Shares", Int64.Type}, {"Shares split adjusted", Int64.Type}, {"Split factor", type number}, {"Assets", Currency.Type}, {"Current Assets", Currency.Type}, {"Liabilities", Currency.Type}, {"Current Liabilities", Currency.Type}, {"Shareholders equity", Currency.Type}, {"Non-controlling interest", Int64.Type}, {"Preferred equity", Int64.Type}, {"Goodwill & intangibles", Currency.Type}, {"Long-term debt", Currency.Type}, {"Revenue", Currency.Type}, {"Earnings", Currency.Type}, {"Earnings available for common stockholders", Currency.Type}, {"EPS basic", Currency.Type}, {"EPS diluted", Currency.Type}, {"Dividend per share", Currency.Type}, {"Cash from operating activities", Currency.Type}, {"Cash from investing activities", Currency.Type}, {"Cash from financing activities", Currency.Type}, {"Cash change during period", Currency.Type}, {"Cash at end of period", Currency.Type}, {"Capital expenditures", Currency.Type}, {"Price", Currency.Type}, {"Price high", Currency.Type}, {"Price low", Currency.Type}, {"ROE", type number}, {"ROA", type number}, {"Book value of equity per share", type number}, {"P/B ratio", type number}, {"P/E ratio", type number}, {"Cumulative dividends per share", Currency.Type}, {"Dividend payout ratio", type number}, {"Long-term debt to equity ratio", type number}, {"Equity to assets ratio", Percentage.Type}, {"Net margin", Percentage.Type}, {"Asset turnover", type number}, {"Free cash flow per share", Currency.Type}, {"Current ratio", type number}})
in
    #"Changed Type"

Is there any way to automatically get more than 100 tables for each one of these Tickers?

I've tried using the Tickers as Parameters, but I don't know how to build the loop so I don't need to repeat the same thing over and over.

 

Thank you so much for the help 🙂

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @ramiroferrando ,

An easy way to do that is using a custom function, then apply this function to all rows by adding a column, after expand the column, for more information, please refer to this blog: https://radacad.com/custom-functions-made-easy-in-power-bi-desktop

Best Regards,

Teige

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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