DAX, or Data Analysis Expressions, is a library of functions, formula and query language used in analytics. It is used in:
- Power BI
- SSAS Tabular models (SQL Server Analysis Services)
- Power Pivot in Excel
To write DAX formulas in Power BI, open Power BI Desktop and go to your dataset. In the example below we have Transactions:
Click on the Ellipse next to the dataset and you will see “New measure” and “New column”:
When you make a selection, for example New measure, a formula bar will appear:
You can then rename the measure (the name defaults to Measure) and provide a formula.
A simple example, let’s say we want to know the number of transactions in the dataset. Transactions in this case refers to sales orders. We can give the measure a new name and then start typing in the DAX formula. As we type, we see intellisense helping:
Once complete, DAX will tell us if the formula is correct or not. If incorrect, we can fix it. If not, we can use the measure as a visualization or other.
I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.
IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.
THANK YOU, AND LET'S KEEP LEARNING TOGETHER.
CARL