Top 20 DAX Functions Every Power BI Developer Should Know
Anurodh Kumar
Freelance PowerBI Developer | Analyzing and Visualizing Data with Microsoft Power BI, Grafana and similar tools.
Top 20 essential DAX functions that every Power BI developer should know, categorized by their key applications:
1. Aggregation Functions
1)SUM: Returns the sum of a column.
Exp---SUM(Sales[Revenue])
2)AVERAGE: Calculates the average of a column.
Exp---AVERAGE(Sales[Quantity])
3)MIN: Returns the smallest numeric value in a column.
Exp---MIN(Sales[Price])
4)MAX: Returns the largest numeric value in a column.
Exp---MAX(Sales[Price])
2. Filter Functions
5)FILTER: Returns a table filtered by a condition.
Exp---FILTER(Sales, Sales[Region] = "North")
6)ALL: Removes filters from a column or table.
Exp---ALL(Sales[Region])
7)CALCULATE: Evaluates an expression with modified filters.
Exp---CALCULATE(SUM(Sales[Revenue]), Sales[Region] = "West")
8)REMOVEFILTERS: Clears all or selected filters from columns or tables.
Exp---REMOVEFILTERS(Sales[ProductCategory])
3. Time Intelligence Functions
Exp---9)DATESYTD: Returns the year-to-date dates.DATESYTD(Calendar[Date])
10)SAMEPERIODLASTYEAR: Returns the same period of the previous year.
Exp---SAMEPERIODLASTYEAR(Calendar[Date])
11)DATEADD: Returns a table of dates shifted by the specified interval.
Exp---DATEADD(Calendar[Date], -1, MONTH)
12)TOTALYTD: Returns the total year-to-date value for the measure.
领英推è
Exp---TOTALYTD(SUM(Sales[Revenue]), Calendar[Date])
4. Logical Functions
13)IF: Returns one value if a condition is true, another if false.
Exp---IF(Sales[Revenue] > 100000, "High", "Low")
14)SWITCH: Evaluates an expression and returns specific values for matching results.
Exp---SWITCH(Sales[Category], "Electronics", "E", "Furniture", "F", "Other")
15)AND: Returns TRUE if both conditions are true.
Exp---AND(Sales[Quantity] > 10, Sales[Price] < 50)
16)OR: Returns TRUE if either condition is true.
Exp---OR(Sales[Discount] > 0.1, Sales[Region] = "West")
5. Table & Relationship Functions
17)RELATED: Returns a related value from another table.
Exp---RELATED(Product[ProductName])
18)LOOKUPVALUE: Returns the value of a column from a related table, filtered by specified criteria.
Exp---LOOKUPVALUE(Product[Price], Product[ProductID], Sales[ProductID])
6. Ranking & Sorting Functions
19)RANKX: Returns the ranking of a value in a table or column.
Exp---RANKX(ALL(Sales), Sales[Revenue])
7. Text Functions
20)CONCATENATE: Combines two text strings into one.
Exp---CONCATENATE(Customer[FirstName], " ", Customer[LastName])
Pursuing Computer Science @Manipal University | Python , SQL , PowerBI | Data Scientist |
5 个月Very helpful