Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to: Calculated column Calculated table Measure Visual calculation
Returns a table as a string in CSV format.
TOCSV(<Table>, [MaxRows], [Delimiter], [IncludeHeaders])
Term | Definition |
---|---|
Table |
The table to be converted to CSV. |
MaxRows |
(Optional) The maximum number fo rows to convert. Default is 10 rows. |
Delimiter |
(Optional) A column delimiter. Default is comma ",". |
IncludeHeaders |
(Optional) Specifies a header with column name as the first row. Default is True. |
A string with CSV representation of the table.
The following DAX query:
EVALUATE
{TOCSV(DimSalesTerritory)}
Returns:
'DimSalesTerritory'[SalesTerritoryKey],'DimSalesTerritory'[SalesTerritoryAlternateKey],'DimSalesTerritory'[SalesTerritoryRegion],'DimSalesTerritory'[SalesTerritoryCountry],'DimSalesTerritory'[SalesTerritoryGroup]
1,1,Northwest,United States,North America
2,2,Northeast,United States,North America
3,3,Central,United States,North America
4,4,Southwest,United States,North America
5,5,Southeast,United States,North America
6,6,Canada,Canada,North America
7,7,France,France,Europe
8,8,Germany,Germany,Europe
9,9,Australia,Australia,Pacific
10,10,United Kingdom,United Kingdom,Europe
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register today