Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Having a dynamic source path (folder and files)

Hi,   I have a PBI report which shows a monthly project details based on the excel files that the team uses on a monthly basis. The data source has: - Monthly folder (Example, "12- December", "11 ...
  • v-jingzhang's avatar
    3 years ago

    Hi Anonymous 

     

    Do you have multiple years of monthly folders in the root folder? I see you only have Month number and name in the folder name without year, so I'd like to know whether "1-January" folder only includes the file for the current 2023 January? If so, you can try

    = Excel.Workbook(File.Contents("C:\........root folder\" & Text.From(Date.Month(DateTime.LocalNow())) & "-" & Date.MonthName(DateTime.LocalNow()) & "\" & Text.From(Date.Month(DateTime.LocalNow())) & "-Project list data.xlsx"), null, true)

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.