🔟 Top 10 DAX Formulas (with examples):
Formula | Purpose | Example |
---|---|---|
SUM() | Adds up column values | SUM(Sales[Amount]) |
AVERAGE() | Mean value | AVERAGE(Orders[Quantity]) |
COUNTROWS() | Count of rows in table | COUNTROWS(Customers) |
CALCULATE() | Applies filters | CALCULATE(SUM(Sales[Amount]), Region = "West") |
FILTER() | Returns filtered table | FILTER(Orders, Orders[Quantity] > 10) |
IF() | Logical condition | IF(Sales[Amount] > 1000, "High", "Low") |
RELATED() | Bring in data from related tables | RELATED(Product[Category]) |
ALL() | Remove filters | CALCULATE(SUM(Sales[Amount]), ALL(Sales)) |
RANKX() | Rank rows | RANKX(ALL(Sales), Sales[Amount]) |
DISTINCTCOUNT() | Unique values count | DISTINCTCOUNT(Customers[CustomerID]) |
💡 Pro Tips:
-
Use CALCULATE with filters to unlock advanced DAX logic
-
Combine RANKX + FILTER for custom leaderboards
-
ALL and ALLEXCEPT are key for ignoring/reporting filters
📌 Conclusion:
-
DAX is powerful, learn the logic behind each formula
-
Next step: build a mini dashboard using these formulas
No comments:
Post a Comment