Forum Discussion
ANDRII_SAV1971
1 year agoRegular Visitor
Dynamic file name of export
Hi Power BI Builder Report version 15.7.1813.16 How to change the file name at the time of export I want to generate a file name with a date value Example - Report_20241012.xls Help me,...
Anonymous
1 year agoNot applicable
Do you need to automatically generate file names when exporting paginated reports? Based on my testing, I'm afraid it is not currently supported. But you can modify it manually.
If you need to modify many files in batches, you can put them into the same folder and use PowerShell to modify them uniformly.
# Set the directory containing the exported Excel files
$exportDirectory = "C:\Path\To\Your\Exported\Files"
# Get today's date and format it
$currentDate = Get-Date -Format "yyyyMMdd"
# Get all Excel files in the directory
$excelFiles = Get-ChildItem -Path $exportDirectory -Filter *.xlsx
# Rename files by adding the date
foreach ($file in $excelFiles) {
$newName = "Report_$currentDate" + "_" + $file.BaseName +$file.Extension
Rename-Item -Path $file.FullName -NewName $newName
}
If I misunderstood your needs, please feel free to correct me.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.