Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Gopal_PV
Helper I
Helper I

How to export Power bi Paginated Report in to CSV with Timestamp , Generated by( Username) Period-

Hi Folks,

I have the paginated Power bi Report CustomerSales. The parameter is Year.

 

The user will select Year Parameter  and Export it into CSV.

My Source is Azure Synapse Server.  I am Publishing into service.

Now i want to Export the report CSV File Name is i.e : Timestamp_UserName_2023.CSV , 24-02-2023_Adam_2023.CSV

 

How achive this in power bi . Can you please help me in this.

Can we achive this if we embedded this report in any Dot Net.

6 REPLIES 6
AmiraBedh
Most Valuable Professional
Most Valuable Professional

In the PBI Desktop, open your paginated report and go to "Parameters", select the Year parameter and go to the Default Values section where you need to set the default value of your parameter as = YEAR(TODAY()) > Save >Publish

In the PBI Service, go to the workspace that contains the report and click on Export and select CSV.
In the Export data to CSV, enter the following: 

=TEXT(NOW(),"dd-MM-yyyy") & "" & USERNAME() & "" & Year & ".CSV"

Then Export

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you amira.

I am developing the report in power bi report builder.  Can i achive same in the report builder?

AmiraBedh
Most Valuable Professional
Most Valuable Professional

In the report builder, select the parameter year and then in the properties go to "Available Values" and select None as the default value.

In the Insert tab, select a text box where you want to display your export button. In the button action choose select URL and use the following expression (this is an example): 

 

= "https://<YOUR_REPORT_SERVER>/PowerBIReportServer/Pages/ReportViewer.aspx?%2fCustomerSales&rs:Format=CSV&rs:Command=Render&Year=" & Parameters!Year.Value & "&rs:ClearSession=true&rs:FileExtension=csv&rs:Command=Render&rs:FileName=" & Format(Now(), "dd-MM-yyyy_hhmmss") & "" & User!UserID & "" & Parameters!Year.Value & ".csv"

 

<YOUR_REPORT_SERVER> : is the URL of your report server


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you amira.

If i am only publishing the report in Power BI Service. Not have  the Report  Server. Do i need server compulsory ?   i am using synpase dedicated sql as source and publishing the same to Service.

 

Please guide me in this.

AmiraBedh
Most Valuable Professional
Most Valuable Professional

Can you explain step by step how you are building your report and how you are publishing it to the Power BI service?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

This is sample report i have taken using EnterData as Source. The requirement is same like this. I have use azure synapse anlytics server for the source. i have connectivity issue hence choosen Enterdata to show you.  User May access this report on service or Dot Net Application.

ReportBuilder1.PNGReportBuilder2.PNGReportBuilder3.PNGReportBuilder4.PNGReportBuilder5.PNGReportBuilder6.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.