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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
How can I expand all the csv format custom table in one go?
Normally below code works for excel contents but it doesn't seem to work with csv files as all values shows null.
Normally use with excel contents
let
// Get list of files in SharePoint folder
Source = SharePoint.Contents("https://XXXX.sharepoint.com/sites/XXX"),
// Get list of files in SharePoint folder
Documents = Source{[Name="Documents"]}[Content],
// Get list of files in SharePoint folder
#"KR Cell Status" = Documents{[Name="KR Cell Status"]}[Content],
// Get list of files in SharePoint folder
#"LGUplus" = #"KR Cell Status"{[Name="LGUplus"]}[Content],
// Get list of files in SharePoint folder
#"5G_DG1" = #"LGUplus"{[Name="5G_DG1"]}[Content],
#"Removed Other Columns" = Table.SelectColumns(#"5G_DG1",{"Content", "Name"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"Name", Order.Descending}}),
#"Kept First Rows1" = Table.FirstN(#"Sorted Rows",5),
#"Added Custom" = Table.AddColumn(#"Kept First Rows1", "Custom", each Csv.Document([Content])),
#"2025_W11_5G_DG1 csv" = #"Added Custom"{[Name="2025_W11_5G_DG1.csv"]}[Custom]
in
#"2025_W11_5G_DG1 csv"
If I clisk Binary:
let
// Get list of files in SharePoint folder
Source = SharePoint.Contents("https://XXX.sharepoint.com/sites/XXX"),
// Get list of files in SharePoint folder
Documents = Source{[Name="Documents"]}[Content],
// Get list of files in SharePoint folder
#"KR Cell Status" = Documents{[Name="KR Cell Status"]}[Content],
// Get list of files in SharePoint folder
#"LGUplus" = #"KR Cell Status"{[Name="LGUplus"]}[Content],
// Get list of files in SharePoint folder
#"5G_DG1" = #"LGUplus"{[Name="5G_DG1"]}[Content],
#"Removed Other Columns" = Table.SelectColumns(#"5G_DG1",{"Content", "Name"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"Name", Order.Descending}}),
#"Kept First Rows1" = Table.FirstN(#"Sorted Rows",5),
#"Added Custom" = Table.AddColumn(#"Kept First Rows1", "Custom", each Csv.Document([Content])),
#"2025_W11_5G_DG1 csv" = #"Added Custom"{[Name="2025_W11_5G_DG1.csv"]}[Content],
#"Imported CSV" = Csv.Document(#"2025_W11_5G_DG1 csv",[Delimiter=",", Columns=54, Encoding=1252, QuoteStyle=QuoteStyle.None])
in
#"Imported CSV"
How csv looks:
Solved! Go to Solution.
Hi @Anonymous
Use Csv.Document function. Sample code
Table.PromoteHeaders( Csv.Document([Content], [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]), [PromoteAllScalars = true])
[Content] refers to the binary column
Since your colum header is not in row 1, you will need to skip a row before applying Table.PromoteHeaders
Table.PromoteHeaders( Table.Skip( Csv.Document([Content], [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]), 1), [PromoteAllScalars = true])
Hi @Anonymous
Use Csv.Document function. Sample code
Table.PromoteHeaders( Csv.Document([Content], [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]), [PromoteAllScalars = true])
[Content] refers to the binary column
Since your colum header is not in row 1, you will need to skip a row before applying Table.PromoteHeaders
Table.PromoteHeaders( Table.Skip( Csv.Document([Content], [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]), 1), [PromoteAllScalars = true])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 46 | |
| 40 | |
| 38 | |
| 22 |
| User | Count |
|---|---|
| 176 | |
| 131 | |
| 118 | |
| 82 | |
| 54 |