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
AnttiKoskinen
Regular Visitor

Latest date as filter in Power BI Dataflow

I'm trying to set a scheduled refresh with following piece of code, which system created automatically for me:

 

 #"Filtered rows 1" = Table.SelectRows(#"Filtered rows", let latest = List.Max(#"Filtered rows"[Date created]) in each [Date created] = latest),
  Navigation = #"Filtered rows 1"{[Name = "bi_daily_examplefile_-_completions_10042024_production.csv", #"Folder Path" = "https://examplecompany.sharepoint.com/sites/Example Site/Shared Documents/Reporting/Production/"]}[Content],
  #"Imported CSV" = Csv.Document(Navigation, [Delimiter = ",", Columns = 86, Encoding = 65001, QuoteStyle = QuoteStyle.None]),
 
With this code scheduled refresh fails because I have filtered the latest date but Navigation line refers to hard coded file not the latest filtered one.
 
Is there a way to code this differently and refer to #"Filtered rows 1" in Navigation?
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

do you want to import the last modified file?  Sort the folder contents accordingly and then grab the binary from row 0.

View solution in original post

2 REPLIES 2
AnttiKoskinen
Regular Visitor

Got it!

lbendlin
Super User
Super User

do you want to import the last modified file?  Sort the folder contents accordingly and then grab the binary from row 0.

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