Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am currently streamlining a project in which we export data in CSV format to an external system. In the past, I have successfully created a table in Power BI with the same layout as I desire for my export. I would then go to optimize queries, press refresh, and copy the DAX query code from there.
However, in this instance, I am encountering an issue where square brackets are appearing around all of the column names. The column names consist of a single word in the format 'name_subname,' with no square brackets and despite my efforts, I cannot find a solution to remove these square brackets.
I am automating this process with Power Automate, and the flow works perfectly, except for the square brackets. Unfortunately, this issue is causing the external system to be unable to read my files.
Is there anyone who can provide assistance or guidance on resolving this issue?
Table PBI
DAX Query:
DEFINE
VAR __DS0Core =
SUMMARIZE(
'Provetdata till SVA',
[Consultation_ID],
[Consultation_started],
[Consultation_ended],
[Clinic_ID],
[Postal_code],
[Postal_city],
[Animal_ID],
[Species_ID],
[Species],
[Breed_ID],
[Breed],
[Gender_ID],
[Gender],
[Deceased],
[Date_of_birth],
[Diagnosis_date],
[Diagnosis_code],
[Diagnosis]
)
VAR __DS0Filtered =
FILTER(
__DS0Core,
[Diagnosis_date] > TODAY() - 8 && 'Provetdata till SVA'[Diagnosis_date] < TODAY()
)
VAR __DS0PrimaryWindowed =
TOPN(
100000,
__DS0Filtered,
[Consultation_ID], 1,
[Consultation_started], 1,
[Consultation_ended],1,
[Clinic_ID],1,
[Postal_code],1,
[Postal_city],1,
[Animal_ID],1,
[Species_ID],1,
[Species],1,
[Breed_ID],1,
[Breed],1,
[Gender_ID],1,
[Gender],1,
[Deceased],1,
[Date_of_birth],1,
[Diagnosis_date],1,
[Diagnosis_code],1,
[Diagnosis],1
)
EVALUATE
SELECTCOLUMNS(
__DS0PrimaryWindowed,
"Consultation_ID", [Consultation_ID],
"Consultation_started", [Consultation_started],
"Consultation_ended", [Consultation_ended],
"Clinic_ID", [Clinic_ID],
"Postal_code", [Postal_code],
"Postal_city", [Postal_city],
"Animal_ID", [Animal_ID],
"Species_ID", [Species_ID],
"Species", [Species],
"Breed_ID", [Breed_ID],
"Breed", [Breed],
"Gender_ID", [Gender_ID],
"Gender", [Gender],
"Deceased", [Deceased],
"Date_of_birth", [Date_of_birth],
"Diagnosis_date", [Diagnosis_date],
"Diagnosis_code", [Diagnosis_code],
"Diagnosis", [Diagnosis]
)
ORDER BY
[Consultation_ID],
[Consultation_started],
[Consultation_ended],
[Clinic_ID],
[Postal_code],
[Postal_city],
[Animal_ID],
[Species_ID],
[Species],
[Breed_ID],
[Breed],
[Gender_ID],
[Gender],
[Deceased],
[Date_of_birth],
[Diagnosis_date],
[Diagnosis_code],
[Diagnosis]
Data output (File and in the new DAX query editor)
Solved! Go to Solution.
Hi @eaj ,
Hmm. The square brackets are kinda needed as they separate the column name from the table name. However
You can try it:
$Results |export-csv -Path $ExportPath -NoTypeInformation
(Get-Content -Path $ExportPath ) -replace '[\[\]]' |Set-Content -Path $ExportPath
This allows you to not include square brackets in the production csv file
The following post will help you:
Solved: Removing square brackets from column headers DAX q... - Microsoft Fabric Community
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @eaj ,
Hmm. The square brackets are kinda needed as they separate the column name from the table name. However
You can try it:
$Results |export-csv -Path $ExportPath -NoTypeInformation
(Get-Content -Path $ExportPath ) -replace '[\[\]]' |Set-Content -Path $ExportPath
This allows you to not include square brackets in the production csv file
The following post will help you:
Solved: Removing square brackets from column headers DAX q... - Microsoft Fabric Community
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
38 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |