Power BI is a powerful tool for creating interactive reports, but what Power BI really Data Analysis Expressions , which is the language used to create measures and calculate insights.

For beginners, here are 5 DAX functions you need to know to create more powerful and flexible reports!
1. CALCULATE() – Change the filtering context
CALCULATE(<Expression>, <Filter1>, <Filter2>, …)
This function is the heart of DAX and is used to change the "Filter Context" of a calculation, such as calculating only for specific years, product categories, or removing certain filters.
Example: Sales for the year 2024 only
Sales_2024 = CALCULATE(SUM(Sales[Amount]), YEAR(Sales[OrderDate]) = 2024)
2. FILTER() – Creates complex conditions
FILTER(<Table>, <Condition>)
is used to create specific conditions for filtering, such as filtering only items with sales greater than 10,000. It is frequently used in conjunction with CALCULATE().
Example: Sales only where the amount is > 10,000
HighSales = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[Amount] > 10000))
3. SUM() – Sums the numerical values
SUM(<Column>)
is the most basic function, used to sum numerical values in a column. It's the starting point for measures in almost every report.
Example: Total Sales
= SUM(Sales[Amount])
4. IF() – Conditional calculation
IF(<Condition>, <Result_True>, <Result_False>)
is used to create a condition, for example, if sales exceed the target, display "Passed"; if less than the target, display "Failed".
Example: Check if the target has been met.
PassTarget = IF(Sales[Amount] > 100000, “Passed”, “Failed”)
5. SAME PERIOD LAST YEAR() – Analysis compared to the previous year
SAMEPERIODLASTYEAR(<DateColumn>)|
is used with Time Intelligence to compare data from the same time period last year. It's suitable for reports that require year-on-year trend analysis.
Example: Last year's sales
: Sales_LY = CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Dates[Date]))
summarize
Understanding and mastering these DAX parameters will help you create powerful Power BI reports, communicate data clearly, and make more accurate decisions
You can find other articles at: https://staging.rdbi.co.th/blog/
For further inquiries or consultations, please contact:
Page: http://bit.ly/rdbipage
Facebook: https://www.facebook.com/RandDBI/
Line OA: @rdbi
Tel: 02-681-9700
Email: sales@rdbi.co.th 🌟
