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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Resident Rockstar
Resident Rockstar

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?

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.