Forum Discussion

Koritala's avatar
Koritala
Icon for Post Patron rankPost Patron
8 months ago
Solved

Exporting 10 million rows to CSV

Hi All,

Is there any solution to export power bi visual data which is having 10 million records into csv file?

I tried with paginated reports. But due to Redshift database limitation that didn't worked.

If you can suggest any work around will be appriciated.

Thnaks,

Sri.

  • Koritala 

    In this scenario, you can use the table visual dax query expression and run it in the dax studio, you might need to tweak the dax query a bit to achive the desiged result. I will explain the steps. 

    1. Disable 'Totals' for the table visual

    2. Copy the table visual's dax query from performance analyzer

     

    3. Open DAX Studio and paste the dax query, for example in my case the query is this 

    // DAX Query
    DEFINE
    	VAR __DS0FilterTable = 
    		TREATAS({"Furniture"}, 'sales_rawtransactions'[product_category])
    
    	VAR __DS0Core = 
    		SUMMARIZECOLUMNS(
    			'sales_rawtransactions'[product_category],
    			'sales_rawtransactions'[product_name],
    			'sales_rawtransactions'[customer_email],
    			__DS0FilterTable,
    			"Sumquantity_sold", CALCULATE(SUM('sales_rawtransactions'[quantity_sold])),
    			"Sumproduct_price", CALCULATE(SUM('sales_rawtransactions'[product_price]))
    		)
    
    	VAR __DS0PrimaryWindowed = 
    		TOPN(
    			501,
    			__DS0Core,
    			'sales_rawtransactions'[product_category],
    			1,
    			'sales_rawtransactions'[product_name],
    			1,
    			'sales_rawtransactions'[customer_email],
    			1
    		)
    
    EVALUATE
    	__DS0PrimaryWindowed
    
    ORDER BY
    	'sales_rawtransactions'[product_category],
    	'sales_rawtransactions'[product_name],
    	'sales_rawtransactions'[customer_email]
    

    Now you need to make some changes to the code 

    4. Remove "Order By clause" it is not required

    5. By default, power bi restricts the number of rows visible in the table visual to 501, You can remove that part from the dax expression and Evaluate the immediate previous table expression, in my case the expression will become 

    // DAX Query
    DEFINE
    	VAR __DS0FilterTable = 
    		TREATAS({"Furniture"}, 'sales_rawtransactions'[product_category])
    
    	VAR __DS0Core = 
    		SUMMARIZECOLUMNS(
    			'sales_rawtransactions'[product_category],
    			'sales_rawtransactions'[product_name],
    			'sales_rawtransactions'[customer_email],
    			__DS0FilterTable,
    			"Sumquantity_sold", CALCULATE(SUM('sales_rawtransactions'[quantity_sold])),
    			"Sumproduct_price", CALCULATE(SUM('sales_rawtransactions'[product_price]))
    		)
    
    
    EVALUATE
    	__DS0Core
    
    
    

    6. Run the code in dax studio just to verify whether it is giving all the required number of rows as result 

    You can check the row count in the right bottom of dax studio

    7. Now in dax studio, change the "Results" to "File" and run the code again

    Thats it, a csv file will be created in your local.

     

    Hope this helps

     

     

     

     

    Connect on LinkedIn

    You can read my blogs here: https://www.techietips.co.in/

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


     

     


     

6 Replies

  • Koritala 

    In this scenario, you can use the table visual dax query expression and run it in the dax studio, you might need to tweak the dax query a bit to achive the desiged result. I will explain the steps. 

    1. Disable 'Totals' for the table visual

    2. Copy the table visual's dax query from performance analyzer

     

    3. Open DAX Studio and paste the dax query, for example in my case the query is this 

    // DAX Query
    DEFINE
    	VAR __DS0FilterTable = 
    		TREATAS({"Furniture"}, 'sales_rawtransactions'[product_category])
    
    	VAR __DS0Core = 
    		SUMMARIZECOLUMNS(
    			'sales_rawtransactions'[product_category],
    			'sales_rawtransactions'[product_name],
    			'sales_rawtransactions'[customer_email],
    			__DS0FilterTable,
    			"Sumquantity_sold", CALCULATE(SUM('sales_rawtransactions'[quantity_sold])),
    			"Sumproduct_price", CALCULATE(SUM('sales_rawtransactions'[product_price]))
    		)
    
    	VAR __DS0PrimaryWindowed = 
    		TOPN(
    			501,
    			__DS0Core,
    			'sales_rawtransactions'[product_category],
    			1,
    			'sales_rawtransactions'[product_name],
    			1,
    			'sales_rawtransactions'[customer_email],
    			1
    		)
    
    EVALUATE
    	__DS0PrimaryWindowed
    
    ORDER BY
    	'sales_rawtransactions'[product_category],
    	'sales_rawtransactions'[product_name],
    	'sales_rawtransactions'[customer_email]
    

    Now you need to make some changes to the code 

    4. Remove "Order By clause" it is not required

    5. By default, power bi restricts the number of rows visible in the table visual to 501, You can remove that part from the dax expression and Evaluate the immediate previous table expression, in my case the expression will become 

    // DAX Query
    DEFINE
    	VAR __DS0FilterTable = 
    		TREATAS({"Furniture"}, 'sales_rawtransactions'[product_category])
    
    	VAR __DS0Core = 
    		SUMMARIZECOLUMNS(
    			'sales_rawtransactions'[product_category],
    			'sales_rawtransactions'[product_name],
    			'sales_rawtransactions'[customer_email],
    			__DS0FilterTable,
    			"Sumquantity_sold", CALCULATE(SUM('sales_rawtransactions'[quantity_sold])),
    			"Sumproduct_price", CALCULATE(SUM('sales_rawtransactions'[product_price]))
    		)
    
    
    EVALUATE
    	__DS0Core
    
    
    

    6. Run the code in dax studio just to verify whether it is giving all the required number of rows as result 

    You can check the row count in the right bottom of dax studio

    7. Now in dax studio, change the "Results" to "File" and run the code again

    Thats it, a csv file will be created in your local.

     

    Hope this helps

     

     

     

     

    Connect on LinkedIn

    You can read my blogs here: https://www.techietips.co.in/

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!


     

     


     

  • Power BI (reports, visuals, paginated reports) is designed for analytics, not bulk data extraction.

    Key hard limits / realities:

    • Export data from visuals → capped (well below millions)

    • Paginated reports → memory-bound, row-by-row rendering, extremely slow at this scale

    • CSV exports → Power BI Service throttles large result sets

    • Redshift via paginated → query timeouts, cursor limits, result-size limits

     

    1) If the data lives in Redshift, export it from Redshift, not Power BI.

    Options:

    • UNLOAD from Redshift → S3 → CSV / Parquet

    • Add filters/logic matching your Power BI model

    • Optionally surface the S3 file link in Power BI

     

    2) Fabric / Lakehouse pattern (recommended if available)

    If you are in Microsoft Fabric:

    1. Load Redshift data into:

      • Lakehouse (Parquet)

      • or Warehouse

    2. Use:

      • Notebook (Spark)

      • SQL endpoint

    3. Export:

      • CSV / Parquet / Delta

      • No row limits

    • Koritala's avatar
      Koritala
      Icon for Post Patron rankPost Patron

      Hi Danextian,

      Thanks for your reply.

      I have gone through the video link. it explained how to export the whole model data export into csv. But my requirment is that I have a table visual with few slicers. I want to export the filtered data in table visaual( 10 million records) instead of entire model data.

      Please suggest me any work around.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Koritala ,

    I would take a moment to thank cengizhanarslan , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
     

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI Koritala ,

      I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.