Forum Discussion
How to create a file with double quotes around the fields
Hello,
I need to generate a file from Power BI where ueach field is sorrounded by double quotes as follows:
"field1","filed2", "fieldn"
Is this possible? How?
Thank you.
5 Replies
- collinq
Super User
Hi imarco62 ,
How about this link:
https://learn.microsoft.com/en-us/https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-stringspower-bi/create-reports/desktop-custom-format-stringsSpecifically this bit:
("ABC") Display the string inside the double quotation marks (" "). - imarco62Regular Visitor
Hello,
The link did not work
- AnonymousNot applicable
Hi, collinq
Thanks for your concern about this issue.
And I would like to share some additional solutions below.
Hi, imarco62
I am glad to help you.
According to your description, you want to create a file with double quotes around the fields?
If I understand you correctly, then you can refer to my solution.You can try to enclose the fields in double quotes directly in Power Query Editor using M language.
As in my example below:
let Source = Excel.Workbook(File.Contents("XX\XX\XX.xlsx"), null, true), Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data], #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"field1", Int64.Type}, {"field2", type text}, {"field3", type text}}), AddQuotesToColumns = Table.TransformColumnNames(#"Promoted Headers", each """" & _ & """") in AddQuotesToColumnsResult:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - AnonymousNot applicable
Hi, imarco62
May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.
If it is not resolved, I hope you will provide the full .pbix file via OneDrive or SharePoint. Please be careful to remove all sensitive information and we will do our best to provide ideas for your issue.I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- imarco62Regular Visitor
I am waiting on the Power BI team to respond. Will post the results as soon as I have them. Thank you.