Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.