XML to DAX Converter

Transform XML data into DAX (Data Analysis Expressions) table format for Power BI and Analysis Services

XML Input

DAX Output

About DAX

DAX (Data Analysis Expressions) is a formula language used in Power BI, Analysis Services, and Power Pivot. This tool converts XML data into DAX calculated table expressions with automatic type detection.

DAX Formats

  • DATATABLE(): Most common format with column names and types (recommended)
  • TABLE(): Simple format without column names
  • ROW() + UNION(): Dynamic format for building tables row by row

Supported Data Types

INTEGER - Whole numbers
DOUBLE - Decimal numbers
STRING - Text values
BOOLEAN - TRUE/FALSE values
DATETIME - Date and time values
BLANK() - Empty/null values

Features

  • Automatic Type Detection: Detects INTEGER, DOUBLE, STRING, BOOLEAN, and DATETIME
  • Multiple Formats: Choose from DATATABLE(), TABLE(), or ROW()+UNION()
  • BLANK() Support: Option to use BLANK() for empty cells
  • Custom Table Names: Specify your own table name
  • Column Name Sanitization: Ensures valid DAX identifiers

Example

Input XML:

<sales>
  <sale>
    <product>Laptop</product>
    <quantity>5</quantity>
    <revenue>4999.95</revenue>
  </sale>
</sales>

Output DAX (DATATABLE):

MyTable = DATATABLE(
	"product", STRING,
	"quantity", INTEGER,
	"revenue", DOUBLE
	{
		{"Laptop", 5, 4999.95}
	}
)

How to Use in Power BI

  1. Copy the generated DAX code
  2. Open Power BI Desktop
  3. Go to "Modeling" tab → "New Table"
  4. Paste the DAX code in the formula bar
  5. Press Enter to create the calculated table

Use Cases

  • Creating lookup tables in Power BI
  • Testing DAX formulas with sample data
  • Building dimension tables
  • Creating parameter tables
  • Prototyping data models
  • Educational and training purposes