![Power-BI-Content-Article.png](https://quantinsightsnetwork.com/wp-content/uploads/2024/04/Power-BI-Content-Article-678x381.png)
In this tutorial, you’ll learn how to create measures in Power BI using Tabular Editor 3. You’ll also learn how to load the measures into the Power BI Desktop and create visualizations. The IntelliSense feature of the Tabular Editor will also be shown and discussed.
Create Measures In Power BI
To create a measure, right-click on a table and select Create. Then, choose Measure.
![1-6 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/1-6.jpg)
![1-6 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/1-6.jpg)
In this example, the Sales table is used to create a measure. You can open the Sales table to see which column can be used in the measure. Right-click on the Sales table and select Preview Data.
![2-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/2-6.jpg)
![2-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/2-6.jpg)
Place the Sales table on the right side of the screen. Your workspace will then look like this.
![3-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/3-5-1024x515.jpg)
![3-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/3-5-1024x515.jpg)
For the measure, the Unit Price, Quantity, and Unit Cost columns will be used. These columns can be used in functions like SUMX, MINX, MAXX, among others. The remaining columns can be used in functions like COUNTROWS and DISTINCTCOUNTNOBLANK.
Maximize The IntelliSense Feature
If you input a keyword of a function in the Expression Editor, a suggestion box will appear. The box contains all functions with the given keyword. In this example, you’ll see the functions that are related to the keyword SUM.
![4-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/4-5.jpg)
![4-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/4-5.jpg)
If you write the initials of a table or column, Tabular Editor will find the table or column that matches the initials. In this example, you can see that the Sales[Unit Price] is suggested using the keyword SUP.
![4a | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/4a.jpg)
![4a | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/4a.jpg)
For this measure, use the SUMX function to get the Total Sales. If you input SUMX, an open and close parenthesis appears. You can also see a suggestion box about the function being used.
![5-6 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/5-6.jpg)
![5-6 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/5-6.jpg)
The box shows that the function is an iterator. It also informs you that the first and second arguments to be used should be a table and an expression, respectively.
The table used for the first argument is the Sales Table. For the second argument, Quantity is multiplied by the Unit Price.
![6-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/6-5.jpg)
![6-5 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/6-5.jpg)
Change the name of the measure to Total Sales.
![7-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/7-4.jpg)
![7-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/7-4.jpg)
Now, if you go back to Power BI and open the Sales table, you can see that the Total Sales measure doesn’t exist.
![8-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/8-5.jpg)
![8-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/8-5.jpg)
Load Measures In Power BI
To load the measure inside Power BI, go back to the Tabular Editor and press CTRL + S. After doing so, the measure will now be deployed in Power BI.
![9-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/9-5.jpg)
![9-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/9-5.jpg)
Create A Visualization
Following that, drag the measure into the report view and turn it into a card visualization.
![10-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/10-6.jpg)
![10-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/10-6.jpg)
You can then see the Total Sales of the table.
![11-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/11-4.jpg)
![11-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/11-4.jpg)
Create Measures For Total Cost and Total Profit
For the next measure, use the SUMX function again and input the Sales table as the first argument. For the second argument, Quantity is multiplied by the Unit Cost.
![12-3 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/12-3.jpg)
![12-3 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/12-3.jpg)
Then, name the measure Total Cost. Once done, press CTRL + S to load the measure inside Power BI.
![13-3 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/13-3.jpg)
![13-3 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/13-3.jpg)
Next, drag the measure into the report view and turn it into a card visualization. You can then see the Total Cost.
![14-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/14-2.jpg)
![14-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/14-2.jpg)
Now, create another measure that subtracts the Total Cost from the total sales. Name the measure Total Profit and then press CTRL + S to load it inside Power BI.
![15-2 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/15-2.jpg)
![15-2 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/15-2.jpg)
Once done, drag the measure and turn it into a card visualization. You can then see the Total Profit of the Sales table.
![16-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/16-2.jpg)
![16-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/16-2.jpg)
Another interesting thing inside the Tabular Editor is that when you open the Total Sales measure and make the tooltip appear on the screen, you can see four filter options at the bottom.
![17-2 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/17-2.jpg)
![17-2 | Master Data Skills + AI create measures](https://blog.enterprisedna.co/wp-content/uploads/2021/10/17-2.jpg)
If you only select the first option, the suggestions you’ll get from the tooltip are only functions.
![18-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/18-2.jpg)
![18-2 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/18-2.jpg)
The second option only shows you the columns of the Sales table.
![19-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/19-1.jpg)
![19-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/19-1.jpg)
The third option shows you the measures that you can use.
![20-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/20-1.jpg)
![20-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/20-1.jpg)
And the fourth option shows you the keywords.
![21-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/21-1.jpg)
![21-1 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/10/21-1.jpg)
Tabular Editor also has the ability to pop up the IntelliSense option. If you accidentally closed the tooltip box, instead of erasing and writing the expression sign again, you can simply press CTRL and the spacebar to make it visible.
***** Related Links *****
DAX Measure Analysis: Breaking Down Long DAX Measures
Building Power BI Reports: Organizing DAX Measures & Page Development
Power BI Tabular Editor 3: Automate With A Script
Conclusion
Tabular Editor 3 lets you conveniently create measures. You can create DAX codes while opening a table or data for reference within the editor itself. It also has the IntelliSense feature to help you bring out and use functions easily.
Enterprise DNA Experts
Be the first to comment