DAX functions on your own data
DAX measures calculate a value in filter context. Run these single-table examples on sample rows or your CSV with xmetric’s Power BI evaluator.
Updated
IF(SUM(Sales[Amount]) > 30, "Above 30", "30 or less")What does this formula return?
Loading the browser engine to calculate this sample…
Edit the sample rowsClick any value · changes recalculate
Empty numeric cells are null. Every input row is used in the calculation.
Use your own CSV
Drop one CSV anywhere. It is calculated in this browser; nothing is uploaded.
Nothing is uploaded.
- dax if — Return one result when a condition is true and another when it is false. This measure compares the sum of Amount with 30.
- dax calculate — Evaluate a measure in a modified filter context. This example sums Amount only for North rows. It has one table and no relationships.
- dax switch — Choose the first matching branch. SWITCH with TRUE lets each branch test a different condition.
- dax lookupvalue — Find a result where the search column matches the requested value. This sample has a unique Period for each row.
- dax sum — Add the non-blank values in a numeric column. The blank sample Amount does not contribute to the sum.
- power bi measure — A DAX measure evaluates in filter context. This amount-per-region measure divides the total by the distinct region count. The playground supplies one table named Sales.
Original worked examples, sources and questions
The recorded examples below retain their original source rows. The live result above uses the current rows and formula.
DAX functions on your own data
DAX measures calculate a value in filter context. Run these single-table examples on sample rows or your CSV with xmetric’s Power BI evaluator.
- dax if — Return one result when a condition is true and another when it is false. This measure compares the sum of Amount with 30.
- dax calculate — Evaluate a measure in a modified filter context. This example sums Amount only for North rows. It has one table and no relationships.
- dax switch — Choose the first matching branch. SWITCH with TRUE lets each branch test a different condition.
- dax lookupvalue — Find a result where the search column matches the requested value. This sample has a unique Period for each row.
- dax sum — Add the non-blank values in a numeric column. The blank sample Amount does not contribute to the sum.
- power bi measure — A DAX measure evaluates in filter context. This amount-per-region measure divides the total by the distinct region count. The playground supplies one table named Sales.
What does the dax if worked example calculate?
Return one result when a condition is true and another when it is false. This measure compares the sum of Amount with 30.
Updated
What formula and inputs define this worked example?
This worked example uses 4 explicitly supplied input rows and their stated field types. Published inputs, field types and recorded results (JSON) identify the exact example.
The formula for this published example is:
IF(SUM(Sales[Amount]) > 30, "Above 30", "30 or less")Microsoft DAX function reference provides the language reference. The linked JSON supplies the concrete input and output for this page.
What recorded result comes from this exact sample formula?
For the formula IF(SUM(Sales[Amount]) > 30, "Above 30", "30 or less"), the published 4-row input has 1 recorded result rows. These are xmetric sample-example results; they do not establish native Tableau or Power BI parity, workbook coverage or corpus-wide compatibility.
| result |
|---|
| Above 30 |
How can I run this example on my own CSV?
Choose or drop one CSV into the live panel, match fields when the Tableau view requires mappings, and use the raw column names or mapped calculation names in that Tableau formula. Mapped names take precedence if names differ only in capitalization or collide. SQL and DAX use your actual column names. Choose Row calculation to write a new Tableau formula on the raw columns. Opening a CSV alone does not calculate a result; select Run formulas to evaluate the current rows. The panel is a progressive enhancement of the formula and recorded example already present in this HTML.
How do Tableau, DuckDB SQL and scalar DAX differ in this example?
Tableau formulas use the shown field types and view settings. DuckDB SQL reads a table named input; xmetric’s Power BI scalar DAX evaluator reads one table named Sales. Each formula runs independently, so successful execution alone does not establish equivalence.
| Language | Formula supplied on this page | Execution and limitation |
|---|---|---|
| Tableau | No TABLEAU translation is supplied for this page. | xmetric’s Tableau calculation and view services use the supplied rows. LOD view grain and table-calculation addressing or partitioning affect results; a CSV does not import hidden workbook calculations. |
| DuckDB SQL | No SQL translation is supplied for this page. | DuckDB compiled to WebAssembly executes the entered query over input. Snowflake, BigQuery and other dialects are not executed by this editor. |
| xmetric Power BI scalar DAX | IF(SUM(Sales[Amount]) > 30, "Above 30", "30 or less") | xmetric evaluates one scalar measure over Sales. A CSV does not supply relationships, hidden measures or a multi-table Power BI model. |
What else do people ask?
Can xmetric chart this CSV?
This page’s panel returns formula-result rows. Open the xmetric browser app to create a chart from your CSV. The calculation shown here is IF(SUM(Sales[Amount]) > 30, "Above 30", "30 or less"); choose dimensions and measures for the question you want to answer.
My client sent a .pbix and I’m on a Mac. Where do I open it?
Open the Power BI Desktop .pbix file in the xmetric browser app. Workbook features determine support. This formula panel accepts CSV or editable JSON rows and evaluates a scalar DAX measure over Sales; it does not import workbook relationships or hidden measures. Opening reads locally; an explicit Save uploads.