Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I have a client's web folder where daily .csv's are uploaded. The .csv files are identical in structure - all that changes is date at the beginning of the file name, which is always YYYYMMDD. They would like to have a dashboard that updates with the new daily file automatically, which I'm struggling to do. As an example, the predicament looks like this:
- On Day 1 I need to access clientwebsite.com/20180423_Data.csv
- On Day 2 I need to access clientwebsite.com/20180424_Data.csv
- On Day 3 I need to access clientwebsite.com/20180425_Data.csv
Any ideas / thoughts on how I might do this?
TIA,
SamB
Solved! Go to Solution.
Hi @Anonymous,
I highligted the part of the code you were missing.
let Source = Csv.Document(Web.Contents( let today = DateTime.Date(DateTime.LocalNow()) in "https://https://www.clientsite.com/" & Number.ToText(Date.Year(today)) & Text.PadStart(Number.ToText(Date.Month(today)),2,"0") & Text.PadStart(Number.ToText(Date.Day(today)),2,"0") & "_users_per_country.csv"), [Delimiter=";", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", Int64.Type}}) in #"Changed Type"
The use of the code is to replace your URL with something dynamic while the remaining parts of your Source variable remain untouched.
Proud to be a Super User!
Hi @danextian,
supposed there is no report for the day, will your code pick up the latest source file? Would it possible to use advanced editor to look for a specific string that is constant in the file name, say for example *users_per_country.csv?
Thanks!
Hi @Anonymous ,
supposed there is no report for the day, will your code pick up the latest source file?
What is your criterion for the latest data source? (filename, date modified, date created?)
Would it possible to use advanced editor to look for a specific string that is constant in the file name, say for example *users_per_country.csv?
It is possible. You can filter the table to rows that ends with a specific text string.
Table.SelectRows(PreviousStep, each Text.End([Column], "users_per_country.csv"))
M is case sensitive so if your file name is not always in the same case, you can try this:
Table.SelectRows(PreviousStep, each Text.End(Text.Lower([Column]), "users_per_country.csv"))
Proud to be a Super User!
Hi @danextian,
That's working perfectly now. Thank you so much for your help - it is much appreciated!
Cheers,
Sam
You're welcome.
Proud to be a Super User!
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
72 | |
44 | |
38 | |
30 |
User | Count |
---|---|
157 | |
90 | |
62 | |
46 | |
40 |