Forum Discussion

ANDRII_SAV1971's avatar
ANDRII_SAV1971
Regular Visitor
1 year ago

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, please

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ANDRII_SAV1971 

     

    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.

  • Hello ANDRII_SAV1971 ,

    You can use powerautomate. There is a node export to file for Paginated Reports. When you added export to file for Paginated Reports. You need to add another actions below export to file for Paginated Reports such as Current Time and last node needs to be addded send an email or to the related sharepoints.

     



    Kind Regards,
    Gรถkberk UzuntaลŸ

    ๐Ÿ“Œ If this post helps, then please consider Accepting it as a solution and giving Kudos โ€” it helps other members find answers faster!

    ๐Ÿ”— Stay Connected:
    ๐Ÿ“˜ Medium |
    ๐Ÿ“บ YouTube |
    ๐Ÿ’ผ LinkedIn |
    ๐Ÿ“ท Instagram |
    ๐Ÿฆ X |
    ๐Ÿ‘ฝ Reddit |
    ๐ŸŒ Website |
    ๐ŸŽต TikTok |

  • I want to implement this for the network version

    So that the user can immediately receive the specified file

    This is not set dynamically - ACCEPTED !

    How can I contact the system developers?

     

    thanks you