TGViewer
Data Analytics Data Analytics @sqlspecialist ยท 111K subscribers
Post #2143 4.07K
Power BI DAX Cheatsheet ๐Ÿš€

1๏ธโƒฃ Basics of DAX (Data Analysis Expressions)

DAX is used to create custom calculations in Power BI.

It works with tables and columns, not individual cells.

Functions in DAX are similar to Excel but optimized for relational data.


2๏ธโƒฃ Aggregation Functions

SUM(ColumnName): Adds all values in a column.

AVERAGE(ColumnName): Finds the mean of values.

MIN(ColumnName): Returns the smallest value.

MAX(ColumnName): Returns the largest value.

COUNT(ColumnName): Counts non-empty values.

COUNTROWS(TableName): Counts rows in a table.


3๏ธโƒฃ Logical Functions

IF(condition, result_if_true, result_if_false): Conditional statement.

SWITCH(expression, value1, result1, value2, result2, default): Alternative to nested IF.

AND(condition1, condition2): Returns TRUE if both conditions are met.

OR(condition1, condition2): Returns TRUE if either condition is met.


4๏ธโƒฃ Time Intelligence Functions

TODAY(): Returns the current date.

YEAR(TODAY()): Extracts the year from a date.

TOTALYTD(SUM(Sales[Amount]), Date[Date]): Year-to-date total.

SAMEPERIODLASTYEAR(Date[Date]): Returns values from the same period last year.

DATEADD(Date[Date], -1, MONTH): Shifts dates by a specified interval.


5๏ธโƒฃ Filtering Functions

FILTER(Table, Condition): Returns a filtered table.

ALL(TableName): Removes all filters from a table.

ALLEXCEPT(TableName, Column1, Column2): Removes all filters except specified columns.

KEEPFILTERS(FilterExpression): Keeps filters applied while using other functions.


6๏ธโƒฃ Ranking & Row Context Functions

RANKX(Table, Expression, [Value], [Order]): Ranks values in a column.

TOPN(N, Table, OrderByExpression): Returns the top N rows based on an expression.


7๏ธโƒฃ Iterators (Row-by-Row Calculations)

SUMX(Table, Expression): Iterates over a table and sums calculated values.

AVERAGEX(Table, Expression): Iterates over a table and finds the average.

MAXX(Table, Expression): Finds the maximum value based on an expression.


8๏ธโƒฃ Relationships & Lookup Functions

RELATED(ColumnName): Fetches a related column from another table.

LOOKUPVALUE(ColumnName, SearchColumn, SearchValue): Returns a value from a column where another column matches a value.


9๏ธโƒฃ Variables in DAX

VAR variableName = Expression RETURN variableName

Improves performance by reducing redundant calculations.


๐Ÿ”Ÿ Advanced DAX Concepts

Calculated Columns: Created at the column level, stored in the data model.

Measures: Dynamic calculations based on user interactions in Power BI visuals.

Row Context vs. Filter Context: Understanding how DAX applies calculations at different levels.

Free Power BI Resources: https://whatsapp.com/channel/0029Vai1xKf1dAvuk6s1v22c

React with โค๏ธ for free cheatsheets

Share with credits: https://t.me/sqlspecialist

Hope it helps :)
  • โค 10
  • ๐Ÿ‘ 2
  • ๐Ÿ‘ 1
More from @sqlspecialist
  1. Oct 17, 2026Sales Fact โ†“ Customer Dimension Product Dimension Date Dimension Region Dimension The factโ€ฆ
  2. Oct 17, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 11 Guys, let's continue our Data Analyst Interviewโ€ฆ
  3. Oct 17, 2026๐—œ๐—•๐—  ๐—™๐—ฅ๐—˜๐—˜ ๐—ง๐—˜๐—–๐—› ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! ๐ŸŽ“ Explore IBM Cognitive Class and buildโ€ฆ
  4. Oct 16, 2026๐——๐—ฎ๐˜๐—ฎ ๐˜€๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ๐Ÿ˜ Future Ready Data Scienโ€ฆ
  5. Oct 14, 2026I could then categorize customers into groups such as Active, At Risk, and Inactive and suโ€ฆ
  6. Oct 14, 2026๐Ÿ“Š Data Analyst Interview Series โ€” Part 10 Guys, let's continue our Data Analyst Interviewโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’