MySQL to DAX Converter
Transform MySQL database dumps into DAX calculated tables for Power BI and Analysis Services
MySQL Input
DAX Output
About MySQL to DAX Converter
Convert MySQL database dumps (CREATE TABLE and INSERT statements) to DAX (Data Analysis Expressions) table expressions for Power BI, Power Pivot, and SQL Server Analysis Services. Create calculated tables directly from your MySQL data.
Key Features
- Three DAX Formats: TABLE(), DATATABLE(), and ROW()/UNION() expressions
- Automatic Type Detection: Detects INTEGER, DOUBLE, BOOLEAN, DATETIME, and STRING types from MySQL data
- BLANK() Support: Empty cells and NULL values converted to BLANK() function
- Custom Table Names: Configure your calculated table name
- Usage Instructions: Optional comments with implementation guidance
- String Escaping: Properly escapes quotes in DAX strings
- Smart Parsing: Extracts column names and data from MySQL dumps
- File Download: Save as .dax file
How to Use
- Input MySQL Data: Paste your MySQL CREATE TABLE and INSERT statements or upload a .sql file
- Set Table Name: Enter the desired calculated table name
- Choose Format: Select TABLE(), DATATABLE(), or ROW()/UNION() format
- Review Output: The DAX expression generates automatically
- Copy to Power BI: Paste into Power BI's "New Table" formula bar
DAX Formats
- TABLE(): Simple format for basic data tables without column definitions
- DATATABLE(): Explicit column types for better performance and type safety (recommended)
- ROW()/UNION(): Calculated table format with named columns, ideal for small reference tables
Example Conversion
MySQL Input:
CREATE TABLE products ( id INT, product VARCHAR(100), price DECIMAL(10,2), quantity INT ); INSERT INTO products VALUES (1, 'Laptop', 999.99, 15); INSERT INTO products VALUES (2, 'Mouse', 29.99, 50);
DAX Output (DATATABLE format):
MyTable = DATATABLE(
"id", INTEGER,
"product", STRING,
"price", DOUBLE,
"quantity", INTEGER,
{
{1, "Laptop", 999.99, 15},
{2, "Mouse", 29.99, 50}
}
) Common Use Cases
- Database Migration: Import MySQL data into Power BI reports
- Reference Tables: Create lookup tables from MySQL dumps
- Static Data: Add configuration or mapping tables to Power BI
- Test Data: Generate sample data for development and testing
- Quick Prototyping: Rapidly create tables for proof-of-concept dashboards
- Data Integration: Combine MySQL data with other Power BI data sources
Data Type Detection
- INTEGER: Whole numbers from MySQL INT, SMALLINT, TINYINT
- DOUBLE: Decimal numbers from MySQL DECIMAL, FLOAT, DOUBLE
- BOOLEAN: TRUE/FALSE values from MySQL BOOLEAN, TINYINT(1)
- DATETIME: Date patterns (YYYY-MM-DD or MM/DD/YYYY)
- STRING: VARCHAR, CHAR, TEXT, and other text data
- BLANK(): Empty cells and NULL values
How to Add to Power BI
- Open Power BI Desktop
- Go to Modeling tab
- Click New Table
- Paste the generated DAX expression
- Press Enter to create the table
Supported MySQL Data Types
- Numeric: INT, BIGINT, DECIMAL, FLOAT, DOUBLE → INTEGER/DOUBLE
- String: VARCHAR, CHAR, TEXT, MEDIUMTEXT, LONGTEXT → STRING
- Boolean: BOOLEAN, TINYINT(1) → BOOLEAN (TRUE/FALSE)
- Date/Time: DATE, DATETIME, TIMESTAMP → DATETIME
- NULL: NULL values → BLANK()
About DAX
DAX (Data Analysis Expressions) is a formula language used in Power BI, Power Pivot, and SQL Server Analysis Services. It's designed for data modeling, calculation, and analysis in business intelligence applications.
Privacy & Security
All conversions happen locally in your browser. Your MySQL data is never uploaded to any server, ensuring complete privacy and security.
