Bugs
Bugs dax-sql found in the engines and specs it compiles to, each reported upstream with the smallest query that shows it. Fixed means closed as completed on GitHub.
Limitations
dax-sql returns the same answers as Power BI, except in the cases below. All of them are by design: dax-sql follows plain SQL rules there, not Power BI's. They are not bugs, and they will not be "fixed".
By design, always
- Text is case-sensitive.
"Red"and"red"are two different values. Power BI treats them as one. - Text sorts by the engine's rules. On DuckDB that is character code order, not Power BI's language-aware order.
- Trailing spaces count.
"a "and"a"are two different values. Power BI removes trailing spaces when it loads data. - The blank row only next to a fact's measures. Sales whose key is missing from a dimension show as a blank group when sales are measured by that dimension's columns. A list of the dimension's values (
VALUES,ALL) has no blank row. - A column that mixes numbers and text comes back as text.
IFERRORreturns its first argument. SQL has no error values.PATHwalks at most 32 levels. A row deeper in its hierarchy gets a blank path. SQL plans have no recursion, so the levels are fixed.- Values come back unformatted. Applying a measure's format string is up to you.
FORMATworks in English (en-US) with a fixed pattern only.
By design, on Microsoft Fabric (T-SQL) only
1 / BLANK()is blank, not infinity. T-SQL has no infinity.- Sums of floating-point numbers are computed exactly, so they can differ from Power BI's in the last digit.
DAX and Ossie SQL differ, by design
- A blank in arithmetic: DAX treats it as 0 (
[Sales] - [Returns]is Sales). SQL keeps it:NULL + 1is NULL. - A count of no rows: blank in DAX, 0 in SQL.
- Fixed decimals: DAX rounds to 4 places. SQL does not round.
- Distinct counts: DAX counts a blank as a value. SQL's
COUNT(DISTINCT)skips NULL.
Not supported
Anything not listed in DESIGN.md.
dax-sql then stops with an UNSUPPORTED error. It never returns a guessed answer.
Every question in SQL is a new query
SQL gives the exact answer, but each question is written from scratch, joins and all.
What you write
The answer
The answer
| Engine | Match | Differs | Design | Not yet | Engine | Flaky | Unexplained |
|---|
Choose an engine to see the queries it does not answer as Power BI does.
About
dax-sql is a compiler for semantic models. A DAX query, or an Apache Ossie SQL query, goes in, with a Power BI
(TMSL) or Ossie model. One SQL SELECT comes out, for DuckDB or Microsoft Fabric. It has no dependencies and
is MIT licensed. It was initially written by N.S. Devaraj.
npm install dax-sql
import { createCompiler } from 'dax-sql';
import { tmslToModel } from 'dax-sql/formats/tmsl.js'; // or formats/ossie.js
const model = tmslToModel(JSON.parse(bimText)); // a model.bim
const dax = createCompiler(model, { tableSource: t => `read_parquet('data/${t.name}.parquet')` });
const { sql, columns } = dax.compile(`EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Sales", [Sales Amount])`);
The full design, with every rule it implements, is in DESIGN.md.
This page
One HTML file. Apart from the SQL labelled hand-written, every SQL snippet on it is compiled in your browser by the compiler from the main branch, and run, when you ask, by DuckDB-WASM 1.32.0. The layout follows ossie_bench.
Not endorsed
Nothing here is endorsed by Microsoft or the Apache Software Foundation. Power BI and DAX are Microsoft's; Apache Ossie is an incubating project of the ASF.