welcome to XRM blog

Keep in touch with latest CRM/ERP articles

To remain competitive your organisation must be efficient across the business process spectrum. To do so you need to take sound decisions based on a balance between the cost and risk. To do so you will be heavily dependent on your content management in itself needs...

image
Blog

Power BI DAX Basics – Commonly Used Functions Explained

By Divya Mishra on 8/1/2025

Introduction 

If you're working with Power BI, learning DAX (Data Analysis Expressions) is essential. DAX is the formula language that drives calculations, filters, and dynamic measures in Power BI. It helps you create custom logic that isn't possible through standard visuals or drag-and-drop aggregations alone. 

In this blog, we’ll explore key DAX concepts, the difference between calculated columns and measures, and dive deep into everyday DAX functions that are used by professionals for real-world reporting scenarios. 

What is DAX? 

It is a functional programming language developed by Microsoft for data modeling. It’s used in Power BI, Excel Power Pivot, and Analysis Services Tabular models. DAX works with columns and tables, not with individual cells like Excel. 

It is designed for data summarization, filtering, context-based calculation, and time intelligence operations. 

Calculated Columns vs. Measures 

Calculated Column: 

Created at row level. 

Stored in the data model and consumes memory. 

Can be used in slicers, filters, and visual grouping. 

Example: FullName = Customers[FirstName] & " " & Customers[LastName] 

Measure: 

Calculated on demand based on filter context. 

Doesn’t take memory per row. 

Ideal for summaries, KPIs, and dynamic reporting. 

Example: Total Sales = SUM(Sales[Amount]) 

Best Practice: Use measures whenever possible to avoid unnecessary memory consumption and improve performance. 

Most Commonly Used DAX Functions (With Examples): 

Here’s a list of frequently used DAX functions in daily Power BI reporting: 

1. SUM(): Adds values from a numeric column. 

Total Sales = SUM(Sales[Amount]) 

2. AVERAGE(): Calculates average of a numeric column. 

Avg Revenue = AVERAGE(Sales[Revenue]) 

3. COUNT() / COUNTA() / COUNTROWS() 

COUNT() = Counts numbers only. 

COUNTA() = Counts all non-blank values. 

COUNTROWS() = COUNTROWS helps you find how many rows exist in a specific table. 

Product Count = COUNTROWS(Products) 

4. DISTINCTCOUNT(): Counts unique values. 

Unique Customers = DISTINCTCOUNT(Sales[CustomerID]) 

5. IF(): Returns value based on condition. 

Profit Status = IF(Sales[Profit] > 0, "Profit", "Loss") 

6. SWITCH(): More readable alternative to multiple IFs. 

Region Category =  

SWITCH( 

    TRUE(), 

    Sales[Region] = "East", "Zone A", 

    Sales[Region] = "West", "Zone B", 

    "Other" 

7. RELATED(): Brings a value from a related table (many-to-one relationship). 

Customer Name = RELATED(Customer[Name]) 

8. CALCULATE(): CALCULATE is a key DAX function that modifies the filter context of an expression, making it extremely useful for creating custom measures. 

Sales in 2023 =  

CALCULATE( 

    [Total Sales], 

    YEAR(Sales[Date]) = 2023 

9. FILTER(): The FILTER function creates a new table that includes only the rows matching a specific condition, often used inside CALCULATE for complex logic. 

High Value Orders =  

CALCULATE( 

    [Total Sales], 

    FILTER(Sales, Sales[Amount] > 10000) 

10. ALL() / REMOVEFILTERS(): ALL and REMOVEFILTERS are used to ignore filters on specific columns or entire tables, helping you see the overall totals or remove slicer effects. 

% of Total Sales =  

DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(Sales))) 

11. SELECTEDVALUE(): Returns the selected value in a slicer or column. 

Selected Year = SELECTEDVALUE('Date'[Year]) 

12. VAR and RETURN: By using VAR and RETURN in DAX, you can define intermediate steps in a calculation, making your formulas easier to read and more efficient to run. 

Profit Margin =  

VAR SalesAmount = SUM(Sales[Amount]) 

VAR Cost = SUM(Sales[Cost]) 

RETURN 

(SalesAmount - Cost) / SalesAmount 

13. ISBLANK(): Checks if a value is blank. 

Is Empty = IF(ISBLANK(Sales[Amount]), "Missing", "Available") 

14. RANKX(): Ranks values in a column based on a measure. 

Product Rank =  

RANKX( 

    ALL(Products), 

    [Total Sales], , 

    DESC, 

    Dense 

15. FORMAT(): Formats values as text. 

Formatted Date = FORMAT(Sales[Date], "DD-MMM-YYYY") 

Time Intelligence Functions: These are essential for date-based analysis, like YTD, QTD, MTD, and prior period comparisons. 

16. TOTALYTD() / TOTALQTD() / TOTALMTD(): Sales YTD = TOTALYTD([Total Sales], 'Date'[Date]) 

17. SAMEPERIODLASTYEAR(): SAMEPERIODLASTYEAR lets you compare values from the current time frame to the exact same period in the previous year — ideal for year-over-year analysis. 

Sales Last Year = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) 

18. DATESINPERIOD(): Returns a table with a date range. 

Sales Last 30 Days = CALCULATE( 

    [Total Sales], DATESINPERIOD('Date'[Date], TODAY(), -30, DAY)) 

19. DATEADD(): Shifts dates backward/forward by a time interval. 

Sales Previous Month = CALCULATE([Total Sales], DATEADD('Date'[Date], -1, MONTH)) 

Pro Tips for Writing DAX 

Use variables (VAR) to keep DAX simple and readable. 

Always test your logic with sample data before using in visuals. 

Use DAX Studio for performance tuning. 

Don’t overuse calculated columns—prefer measures whenever aggregation is needed. 

Name your measures clearly (e.g., Total Sales, not Measure 1). 

Conclusion 

By mastering these common functions, you’ll be able to: Create smart KPIs,  Analyze trends, Build dynamic dashboards and Enable self-service analytics. 

#DAXFunctions
#MeasureVsCalculatedColumn
#PowerBI
#PowerBIBasics
#PowerBIDAX
Blog Calendar
Blog Calendar List
2025 Aug  1  2
2025 Jul  13  9
2025 Jun  21  6
2025 May  49  9
2025 Apr  35  6
2025 Mar  54  7
2025 Feb  41  6
2024 Nov  11  1
2024 Aug  8  1
2024 Apr  59  4
2024 Mar  164  4
2024 Feb  476  3
2024 Jan  33  7
2023 Dec  40  6
2023 Nov  611  5
2023 Oct  819  12
2023 Sep  1925  9
2023 Aug  591  6
2023 Jul  47  6
2023 Jun  26  4
2023 May  44  5
2023 Apr  87  5
2023 Mar  227  6
2023 Feb  175  5
2023 Jan  85  4
2022 Dec  96  7
2022 Nov  295  2
2022 Sep  13  1
2022 Aug  32  2
2022 Jun  11  2
2022 May  6  2
2022 Apr  12  2
2022 Mar  2  1
2022 Feb  2  1
2022 Jan  1  1
2021 Dec  4  1
2021 Nov  2  1
2021 Oct  2  1
2021 Sep  14  1
2021 Aug  49  5
2021 Jul  51  4
2021 Jun  1889  5
2021 May  43  3
2021 Apr  2265  3
2021 Mar  217  5
2021 Feb  2798  7
2021 Jan  4231  9
2020 Dec  593  7
2020 Sep  82  3
2020 Aug  792  3
2020 Jul  139  1
2020 Jun  100  3
2020 Apr  103  3
2020 Mar  19  2
2020 Feb  34  5
2020 Jan  48  7
2019 Dec  17  4
2019 Nov  41  1
2019 Jan  23  2
2018 Dec  145  4
2018 Nov  68  3
2018 Oct  18  3
2018 Sep  1284  11
2018 Aug  7  2
2018 Jun  21  1
2018 Jan  73  2
2017 Sep  590  5
2017 Aug  17  1
2017 Jul  17  2
2017 Jun  65  2
2017 May  21  1
2017 Apr  39  2
2017 Mar  142  4
2017 Feb  859  4
2016 Dec  208  3
2016 Nov  1087  8
2016 Oct  343  10
2016 Sep  816  6
2016 Aug  39  1
2016 Jun  1894  6
2016 May  115  3
2016 Jan  72  2
2015 Dec  763  6
2015 Nov  4  1
2015 Oct  13  1
2015 Sep  1472  6
2015 Aug  14  1
2015 Jul  129  2
2015 Jun  11  1
2015 May  20  1
2015 Apr  30  3
2015 Mar  80  3
2015 Jan  5350  4
2014 Dec  18  1
2014 Nov  2260  4
2014 Oct  69  1
2014 Sep  107  2
2014 Aug  5343  1
2014 Jul  49  2
2014 Apr  2600  12
2014 Mar  308  17
2014 Feb  223  6
2014 Jan  1510  16
2013 Dec  21  2
2013 Nov  695  2
2013 Oct  256  3
2013 Sep  13  1
2013 Aug  40  3
2013 Jul  214  1
2013 Apr  62  6
2013 Mar  2401  10
2013 Feb  131  3
2013 Jan  352  2
2012 Nov  63  2
2012 Oct  519  10
Tag Cloud
Interested in our services? Still not sure about project details? get a quote