CSV To DAX Table

Login

Email
Password

Don't have an account yet?

Go to Sign up

{{ workbook ? 'Online Table Editor' : 'Input Data' }}
Change File Enter Data
Row Col Row Col
Transpose Clear Delete Empty Deduplicate
ABC abc Abc
Replace
First Row as Header
{{ displayRows.length }} rows x {{ displayHeaders.length }} columns{{ firstRowAsHeader ? ' (1 header)' : '' }} {{ selectedRows.length > 0 ? selectedRows.length + ' selected' : '' }}
Output Data
{{ copied ? 'Copied!' : 'Copy to Clipboard' }} Download File
Properties
Convert CSV to DAX Table online — paste, edit, and download DAX.

Format:
DATATABLE Table
Indent:
2 Spaces 4 Spaces Tab
Table Name:
Convert Restart
Insert Row Below
Insert Row Above
Insert Column Right
Insert Column Left
Delete Row {{ contextMenu.row + 1 }}
Delete Column {{ contextMenu.col + 1 }}
Clear Cell
Clear Row
Case sensitive Use regex Cancel Replace All

What Is the CSV to DAX Table Converter?

DAX (Data Analysis Expressions) is the formula language behind Microsoft Power BI, Power Pivot for Excel, and SQL Server Analysis Services Tabular models. A common task when building Power BI reports is creating small lookup or dimension tables directly in the data model — without importing external files. The CSV to DAX Table Converter on A.Tools generates the DAX code for these calculated tables from any CSV or TSV file.

Paste the output into Power BI Desktop's New Table dialog and your data is instantly available in the model.

All processing runs locally in your browser. No data leaves your device.


Core Features

Two DAX Output Formats

DATATABLE Format

Uses the DATATABLE() function with explicit column names and data types:

MyTable =

DATATABLE (

   "Name", STRING,

   "Age", INTEGER,

   "Salary", DOUBLE,

   {

       ("Alice", 30, 75000.50),

       ("Bob", 25, 62000.00)

   }

)

Advantages:

  • Explicit data types prevent type inference errors.

  • Fully typed columns ensure correct sorting, filtering, and relationships.

  • Recommended for production Power BI models.

TABLE Constructor Format

Uses the curly-brace {} constructor with inline ROW() calls:

MyTable =

{

   ROW("Name", "Alice", "Age", 30, "Salary", 75000.50),

   ROW("Name", "Bob", "Age", 25, "Salary", 62000.00)

}

Advantages:

  • More compact syntax.

  • Faster for quick prototyping.

  • Column names are defined inline.

Data Type Inference

The tool automatically detects column data types from your CSV content:

CSV Value PatternDAX TypeExample
"Alice", "NYC"STRINGSTRING
30, -5INTEGERINTEGER
75000.50, 3.14DOUBLEDOUBLE
true, falseBOOLEANBOOLEAN
2026-05-07DATETIMEDATETIME

DATATABLE format includes these types explicitly. TABLE format relies on DAX runtime inference.

Table Name

Enter a name in the Table Name field to prefix the DAX expression: TableName = DATATABLE(...). If left empty, only the right side of the expression is generated.

Indentation Options

OptionUse Case
2 SpacesCompact, matches most DAX style guides
4 SpacesWider readability, matches Power BI Desktop default
TabIf your DAX formatter uses tabs

Online Table Editor

Edit your data in-browser before converting:

  • Undo / Redo — Full edit history.

  • Add / Delete Rows & Columns — Expand or trim the table.

  • Transpose — Swap rows and columns.

  • Delete Empty — Remove empty rows and columns.

  • Deduplicate — Remove duplicate rows.

  • ABC / abc / Abc — Batch case conversion.

  • Find & Replace — With regex support.

  • First Row as Header — Toggle header treatment.

Privacy & Security

All processing runs client-side via the browser File API. Files are never uploaded, transmitted, or stored. Safe for business-sensitive dimension data, organizational structures, and proprietary lookup tables.


How to Use the CSV to DAX Table Converter

Step 1 — Load Your Data

Upload a .csv or .tsv file by dragging it onto the upload area, or click to browse. Alternatively, click Enter Data to type or paste data directly.

Step 2 — Edit Your Data (Optional)

Use the toolbar to refine your data:

  • Add, insert, or delete rows and columns.

  • Transpose the table.

  • Remove empty rows/columns or duplicate rows.

  • Change text case.

  • Find and replace values (supports regex).

  • Toggle First Row as Header to define column names.

Step 3 — Configure DAX Properties

In the Properties panel:

OptionWhat to Set
FormatDATATABLE (typed) or TABLE (compact)
Indent2 spaces, 4 spaces, or tab
Table NameThe name for the calculated table in Power BI (e.g., DimProduct)

Step 4 — Convert

Click Convert. The DAX code appears in the Output Data panel.

Step 5 — Use in Power BI

  1. Open Power BI Desktop.

  2. Go to Modeling > New Table.

  3. Paste the DAX code into the formula bar.

  4. Press Enter. The table appears in your data model.


Practical Examples

Example 1: Product Category Dimension Table (DATATABLE)

Input CSV:

CategoryID,CategoryName,SubCategory

1,Electronics,Phones

2,Electronics,Laptops

3,Home,Appliances

4,Home,Furniture

Settings: Format = DATATABLE, Indent = 4, Table Name = DimCategory

Output:

DimCategory =

DATATABLE (

   "CategoryID", INTEGER,

   "CategoryName", STRING,

   "SubCategory", STRING,

   {

       ( 1, "Electronics", "Phones" ),

       ( 2, "Electronics", "Laptops" ),

       ( 3, "Home", "Appliances" ),

       ( 4, "Home", "Furniture" )

   }

)

Example 2: Date Reference Table (TABLE Constructor)

Input CSV:

Quarter,Label,Q1Start,Q1End

Q1,Jan-Mar,2026-01-01,2026-03-31

Q2,Apr-Jun,2026-04-01,2026-06-30

Q3,Jul-Sep,2026-07-01,2026-09-30

Q4,Oct-Dec,2026-10-01,2026-12-31

Settings: Format = TABLE, Indent = 2, Table Name = QuarterRef

Output:

QuarterRef =

{  

   ROW("Quarter", "Q1", "Label", "Jan-Mar", "Q1Start", "2026-01-01", "Q1End", "2026-03-31"),  

   ROW("Quarter", "Q2", "Label", "Apr-Jun", "Q1Start", "2026-04-01", "Q1End", "2026-06-30"),  

   ROW("Quarter", "Q3", "Label", "Jul-Sep", "Q1Start", "2026-07-01", "Q1End", "2026-09-30"),  

   ROW("Quarter", "Q4", "Label", "Oct-Dec", "Q1Start", "2026-10-01", "Q1End", "2026-12-31")

}

Example 3: Parameter Table for What-If Analysis

Input CSV:

Scenario,GrowthRate,DiscountFactor

Optimistic,0.15,0.95

Base,0.08,0.90

Pessimistic,0.02,0.85

Settings: Format = DATATABLE, Indent = 2, Table Name = Scenarios

Output:

Scenarios =

DATATABLE (  

   "Scenario", STRING,  

   "GrowthRate", DOUBLE,  

   "DiscountFactor", DOUBLE,  

   {

       ( "Optimistic", 0.15, 0.95 ),

       ( "Base", 0.08, 0.90 ),

       ( "Pessimistic", 0.02, 0.85 )  

   }

)


Understanding DAX Table Constructors

What Is DAX?

DAX (Data Analysis Expressions) is a formula language introduced by Microsoft for use in Power BI, Power Pivot, and SSAS Tabular models. It extends Excel's formula capabilities with relational data operations, time intelligence, and table manipulation functions. Reference: Microsoft Learn — DAX reference.

DATATABLE() Function

DATATABLE() creates an inline table with explicit column definitions:

TableName =

DATATABLE (

   "Column1", TYPE1,

   "Column2", TYPE2,

   {

       (value1, value2),

       (value3, value4)

   }

)

Supported DAX data types:

  • STRING — Text values.

  • INTEGER — Whole numbers.

  • DOUBLE — Floating-point numbers.

  • BOOLEAN — True/false.

  • DATETIME — Date and time values.

  • CURRENCY — Fixed-precision decimal numbers.

TABLE Constructor {}

The curly-brace constructor creates a table from ROW() calls:

TableName =

{

   ROW("Col1", val1, "Col2", val2),

   ROW("Col1", val3, "Col2", val4)

}

DAX infers types from the first row's values. This is simpler but less explicit.

When to Use DAX Calculated Tables

DAX calculated tables are ideal for:

  • Dimension/lookup tables — Product categories, regions, status codes.

  • Date reference tables — Fiscal calendars, holiday lists.

  • What-if parameters — Scenario analysis tables.

  • Bridge tables — Many-to-many relationship resolution.

  • Static reference data — Exchange rates, mapping tables.

They are stored in the Power BI data model and refreshed on dataset refresh. For large datasets (hundreds of rows), consider importing via Power Query instead.

Limitations

  • DAX calculated tables are static — they do not connect to external data sources.

  • Very large tables (thousands of rows) generate lengthy DAX code that may slow down Power BI Desktop.

  • DATATABLE supports up to 64 columns and is subject to Power BI's 1MB formula bar limit.


Frequently Asked Questions

  • Is my CSV data uploaded to a server?

    No. All file processing happens entirely in your browser using JavaScript. Your CSV data is never uploaded, transferred, or stored on any server.

  • What is DAX?

    DAX (Data Analysis Expressions) is the formula language used in Microsoft Power BI, Power Pivot for Excel, and SQL Server Analysis Services Tabular models. It is used to define calculated columns, measures, and calculated tables. See Microsoft Learn DAX reference for the official documentation.

  • What is the difference between DATATABLE and TABLE format?

    DATATABLE uses the DATATABLE() function with explicit column names and data types, producing a fully typed table. TABLE uses the {} constructor with ROW() calls, which is more compact but relies on DAX type inference. Use DATATABLE for production models; use TABLE for quick prototyping.

  • How do I paste the DAX code into Power BI?

    In Power BI Desktop, go to Modeling > New Table. A formula bar appears at the top of the screen. Paste the generated DAX code and press Enter. The table will be created in your data model.

  • What data types are supported?

    The DATATABLE format supports STRING, INTEGER, DOUBLE, BOOLEAN, DATETIME, and CURRENCY. The tool auto-detects types from your CSV data. The TABLE constructor format relies on DAX runtime inference.

  • Is there a row limit?

    DAX calculated tables are limited by Power BI's formula bar size (approximately 1MB of DAX text). For most dimension tables with 10-20 columns, this supports up to a few hundred rows. For larger datasets, import via Power Query instead.

  • What file formats are supported?

    The tool accepts .csv (comma-separated values) and .tsv (tab-separated values) files. You can also enter data manually through the built-in table editor.

  • Can I use this with Power Pivot in Excel?

    Yes. The generated DAX code works in both Power BI Desktop and Power Pivot for Excel. In Excel, go to Power Pivot > Design > Create Calculated Table and paste the code.

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.

Excel To JSON

Free online Excel to JSON converter. Transform XLSX, XLS, XLSM files into JSON arrays, objects, or keyed formats instantly in your browser — no upload, 100% private.
Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.

Excel To CSV

Free Excel to CSV converter. Convert XLSX, XLS, XLSM to CSV instantly in your browser. No upload, 100% private. Edit, transpose, deduplicate before exporting.
Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.

Excel To SQL

Free online Excel to SQL converter. Generate CREATE TABLE and INSERT statements from spreadsheets for MySQL, PostgreSQL, SQLite, and SQL Server. Supports batch insert, primary keys, and type inference.
Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.

Excel To ASCII Table

Free online Excel to ASCII table converter with 10 border styles (MySQL, Unicode, reStructuredText, and more). Add code comment wrappers in 8 languages. Supports text alignment. Client-side processing.