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
Falaerm
Frequent Visitor

How to do scrapping with 2 functions that determine the interval period and the different quotes?

Hello,

 

I have a Power BI Desktop with url data source from yahoo finance and one excel file for using a funciton. I am following a tuto how to do scrapping with data from Yahoo finance and I managed to create a table, but now I would like to add a function that let me to choose and change the interval period ("d", "wk","mo") of my data source from the yahoo fiannce url. The letter in Red and bold is the letter I need to change in the Url. I tried to creat another fuinction or create a double function but nothing worked...At the end I want to have a slicer that let me chosse the period (daily, weekly, monthly).

File (Soft Commodity Tab)

Power Bi File 

(SoftQuote as text) as table=>

let
Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/"&SoftQuote&"?period1=1658534400&period2=1690070400&interval=1d&events=history&includeAdjustedClose=true"),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"En-têtes promus" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Valeur remplacée" = Table.ReplaceValue(#"En-têtes promus",".",",",Replacer.ReplaceText,{"Open", "High", "Low", "Close", "Adj Close", "Volume"}),
#"Type modifié" = Table.TransformColumnTypes(#"Valeur remplacée",{{"Open", type text}, {"High", type text}, {"Low", type text}, {"Close", type text}, {"Adj Close", type text}, {"Volume", Int64.Type}})
in
#"Type modifié"

 Many thanks ,

 

Romain

3 REPLIES 3
foodd
Super User
Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Falaerm
Frequent Visitor

Thank you food,

 

The thing is like I don't know how top share my work as I can't publish my work and your first link doesn't work. I put a one drive link instead.

 

Best,

 

Romain

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.

Top Solution Authors
Top Kudoed Authors