2
votes

I feel I'm missing the point with something! You can write DAX Queries in the excellent DAX Studio add-in:

enter image description here

You can also write DAX against a tabular model in Management Studio 2017 and above:

enter image description here

But that seems to be it! In particular, there doesn't seem any way to write DAX queries using EVALUATE in Power BI Desktop or PowerPivot. Am I missing something?

4
Visual Studio, Power BI and SSMS.StelioK
Also in Excel (Power Query).Seymour
This question is becoming out of date.Andy Brown

4 Answers

3
votes

For Power BI, calculated table which is a Microsoft article explaining how to do this. It involves selecting new table under the modeling tab.

It is also possible to create DAX queries in excel for power pivot, though it is a less straight forward way. Also note that the DAX editor for doing the below is not the greatest.

To do this you would do the following:

  1. Go to the data tab

  2. Select existing connections

3.Click on the tables tab

  1. Select on of your table, a screen will pop up asking how to output select table and excel will create a table

5.Right click the table, in the drop down do table --> Edit DAX.

  1. In the window that opened, change the command type in the drop down to DAX

  2. Write your query. Hitting on will update the table to the results of your query.

Just keep in mind that this method is better when you already have your DAX query written.

0
votes

There's also a way to create DAX-Measures in MDX queries (unfortunately it doesn't work in Excel). But in case you have other client tools compatible with MDX, it's quite useful.

https://docs.microsoft.com/en-us/sql/mdx/mdx-data-definition-create-measure?view=sql-server-ver15

0
votes

Nowadays You can use DAX in SSAS creating calculated columns and calculated measures in OLAP cubes, in Power BI also to create new columns and measures. DAX is really powerful language used by Microsoft reporting tools.