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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors