Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
When I exporting the table visualisation to CSV file, on opening with Excel, I observed many values are pasted in 1st cell in the Excel.
Note: I used TOCSV dax to create a measure and used the same in table visualisation.
Is there any way that I can download the CSV with each row pasted in correct format
Solved! Go to Solution.
The issue arises because when you use the TOCSV
function in a DAX measure, it concatenates all the values into a single string with a specified delimiter. When you export this to a CSV and open it in Excel, Excel treats the entire string as a single cell because it doesn't recognize the delimiters within the string as separating individual columns.
Unfortunately, there isn’t a direct way in Power BI to convert this TOCSV
string into separate columns in the exported CSV via a DAX measure. The TOCSV
function is intended to create a single string output, which is why Excel places it all in one cell.
Given this limitation, here are a couple of alternative approaches you might consider:
If the goal is to have each value in its correct cell in the CSV:
TOCSV
Measure: Instead of using a TOCSV
measure, place the individual columns directly in the table visualization.If you must use TOCSV
and need to separate values after exporting:
Custom Delimiter: Ensure that the delimiter used in TOCSV
is a character that isn’t present in your data (e.g., |
).
Export to CSV: After exporting the visualization, open the CSV in Excel.
Text to Columns: Use Excel’s Text to Columns feature to split the values into separate columns based on your chosen delimiter.
Steps in Excel:
TOCSV
output.TOCSV
(e.g., |
).If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
The issue arises because when you use the TOCSV
function in a DAX measure, it concatenates all the values into a single string with a specified delimiter. When you export this to a CSV and open it in Excel, Excel treats the entire string as a single cell because it doesn't recognize the delimiters within the string as separating individual columns.
Unfortunately, there isn’t a direct way in Power BI to convert this TOCSV
string into separate columns in the exported CSV via a DAX measure. The TOCSV
function is intended to create a single string output, which is why Excel places it all in one cell.
Given this limitation, here are a couple of alternative approaches you might consider:
If the goal is to have each value in its correct cell in the CSV:
TOCSV
Measure: Instead of using a TOCSV
measure, place the individual columns directly in the table visualization.If you must use TOCSV
and need to separate values after exporting:
Custom Delimiter: Ensure that the delimiter used in TOCSV
is a character that isn’t present in your data (e.g., |
).
Export to CSV: After exporting the visualization, open the CSV in Excel.
Text to Columns: Use Excel’s Text to Columns feature to split the values into separate columns based on your chosen delimiter.
Steps in Excel:
TOCSV
output.TOCSV
(e.g., |
).If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
User | Count |
---|---|
117 | |
73 | |
58 | |
49 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |