Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
otykier committed Nov 20, 2023
2 parents ce1b7ea + 7532eaf commit 61c5619
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common/Datasets/direct-lake-dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Direct Lake semantic models connect directly to data sources stored in [Fabric O
> Changing a Direct Lake dataset through the XMLA endpoint will block your ability to change the Direct Lake dataset inside the Fabric Service. Only XMLA endpoint can then edit the Direct Lake This is one of the current limitations of this preview
feature.

Tabular Editor 3 can create and connect to this type of dataset. For a tutorial on this please refer to our blog article: [Direct Lake semantic models: How to use them with Tabular Editor](https://blog.tabulareditor.com/2023/08/23/fabric-direct-lake-dataset)
Tabular Editor 3 can create and connect to this type of dataset. For a tutorial on this please refer to our blog article: [Direct Lake semantic models: How to use them with Tabular Editor](https://blog.tabulareditor.com/2023/09/26/fabric-direct-lake-with-tabular-editor-part-2-creation/).
Tabular Editor 3 can create direct lake semantic models with both the Lakehouse and Datawarehouse SQL Endpoint.

Tabular Editor 2 can connect to Direct Lake semantic models, but does not have any built in functionality to create new tables or direct lake semantic models. This needs to be done manually or with a C# script.

Expand All @@ -36,4 +37,5 @@ Tabular Editor 2 can connect to Direct Lake semantic models, but does not have a
Fabric is currently in preview and there are therefore several limitations to the changes that can be made to a Direct Lake dataset: <a href="https://learn.microsoft.com/en-us/power-bi/enterprise/directlake-overview#known-issues-and-limitations">Direct Lake Known Issues and Limitations</a>
</div>


## Identifying a Direct Lake model
The TOM Explorer informs what object type your tables are. A Direct Lake model's tables will have the object type 'Table (DirectLake)' to make clear that the open model is a Direct Lake model.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions te3/features/dax-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
uid: dax-query
title: DAX Queries
author: Morten Lønskov
updated: 2023-11-09
applies_to:
editions:
- edition: Desktop
- edition: Business
- edition: Enterprise
---
# DAX Queries

Tabular Editor has a built in DAX query window to write and execute DAX queries against the semantic model.

A very common use case for DAX queries is the DAX query produced by the [Power BI Performance Analyzer](https://www.sqlbi.com/articles/introducing-the-power-bi-performance-analyzer/), where it is possible to copy the query of each visual for troubleshooting, debugging or detailed performance analysis.

The window can be opened while connected to a sematic model by using either the **File > New > DAX Query** menu or the toolbar shortcut.

![Dax Query New](~/images/features/dax_query_window/create_new_dax_query.png)

The built in context aware intellisense ensures that only the two valid DAX keywords are available when starting a new query: DEFINE or EVALUATE (Press Ctrl+Space to verify for yourself)

## DAX Query Options

The DAX query window has four different query options.

![Dax Query New](~/images/features/dax_query_window/dax_query_toolbar.png)


1. Execute (F5)
2. Execute Selection (Shift+F5)
3. Stop
4. Auto Execute Query

The Auto Execute Query allows for keeping track of the connected semantic model and update the query results whenever something changes in the model. This can be useful for understanding e.g. how the result of a measure changes if modified.

## DAX Query Example

A DAX query always return a table of results, and the simplest form of DAX query to create is one that evaluates a table within the model.

```DAX
EVALUATE
Products
```
![Dax Query New](~/images/features/dax_query_window/evaluate_table.png)

It is also possible to return the value of a measure but a table constructor {} is required around the measure name, to turn the scalar value into a 1x1 table.


```DAX
EVALUATE
{ [Invoice Lines] }
```
![Dax Query New](~/images/features/dax_query_window/evaluate_measusre.png)

### Multiple EVALUATE statements
It is perfectly possible to have multiple EVALUATE statements inside the same DAX query. This type of query is most often encountered with Power BI Performance Analyzer queries.

Both tables are returned in the below statement, but as separate row tabs in the result pane.

```DAX
EVALUATE
Products
EVALUATE
Customers
```

![Dax Query New](~/images/features/dax_query_window/multiple_evaluate_table.png)

## Debugging DAX Query
DAX queries is one of the two places where it is possible to run the [DAX Debugger](xrefid:dax-debugger), the other being the Pivot Grid.

The DAX debugger unlocks the ability to understand how the DAX works inside a single cell. To start the debugger simply right click on the desired cell and choose 'Debug cell', which will start the debugger in the context of the chosen cell.

![Dax Query New](~/images/features/dax_query_window/dax_query_open_dax_debugger.gif)

1 change: 1 addition & 0 deletions te3/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
### @perspective-editor
### @metadata-translation-editor
### @dax-debugger
### @dax-query
## @supported-files
### @tmdl
## @preferences
Expand Down

0 comments on commit 61c5619

Please sign in to comment.