Skip to main content

20 Power BI Dax Measures


UserPower bi 20 dax measures 20 DAX (Data Analysis Expressions) measures in Power BI with examples:
  1. Total Sales:

    scss
    Total Sales = SUM(Sales[Amount])
  2. Average Sales Price:

    scss
    Avg Sales Price = AVERAGE(Sales[Amount])
  3. Total Units Sold:

    mathematica
    Total Units Sold = SUM(Sales[Quantity])
  4. Total Customers:

    scss
    Total Customers = COUNTROWS(Customer)
  5. Total Products:

    mathematica
    Total Products = COUNTROWS(Product)
  6. Maximum Sales Amount:

    scss
    Max Sales Amount = MAX(Sales[Amount])
  7. Minimum Sales Amount:

    scss
    Min Sales Amount = MIN(Sales[Amount])
  8. Sales Growth Percentage:

    mathematica
    Sales Growth % = (Total Sales - [Total Sales Last Year]) / [Total Sales Last Year]
  9. Total Profit:

    scss
    Total Profit = SUM(Sales[Profit])
  10. Total Orders:

    scss
    Total Orders = COUNTROWS(Orders)
  11. Total Customers with Sales:

    css
    Total Customers with Sales = COUNTROWS(FILTER(Customer, [Total Sales] > 0))
  12. Total Sales by Region:

    mathematica
    Total Sales by Region = SUMX(VALUES(Region[RegionName]), [Total Sales])
  13. Total Sales by Year:

    scss
    Total Sales by Year = SUMX(VALUES(Calendar[Year]), [Total Sales])
  14. Running Total Sales:

    scss
    Running Total Sales = SUMX(FILTER(ALL(Calendar), Calendar[Date] <= MAX(Calendar[Date])), [Total Sales])
  15. Top N Products by Sales:

    mathematica
    Top N Products by Sales = TOPN(5, ALL(Product), [Total Sales])
  16. Rolling Average Sales (3 Months):

    scss
    Rolling Avg Sales 3M = AVERAGEX(DATESYTD(Calendar[Date]), [Total Sales])
  17. Total Sales to Date:

    mathematica
    Total Sales to Date = TOTALYTD([Total Sales], Calendar[Date])
  18. Sales Rank by Product:

    mathematica
    Sales Rank by Product = RANKX(ALL(Product), [Total Sales], , DESC, Dense)
  19. Customer Churn Rate:

    css
    Customer Churn Rate = DIVIDE([Lost Customers], [Total Customers])
  20. Year-to-Date Growth:

    mathematica
    YTD Growth = DIVIDE([Total Sales], [Total Sales Last Year]) - 1

These measures cover a range of common calculations in Power BI, including basic aggregations, comparisons, and time-based calculations. You can adapt and customize them to suit your specific data and reporting needs

Comments

Popular posts from this blog

CAGR Dax Measure

CAGR stands for  C ompound  A nnual  G rowth  R ate.  It describes the rate at which an investment would have grown over several years if it had grown at the same rate every year on a compounding, rather than simple, basis.   The CAGR metric is calculated using the following formula: If we were to fit this entire formula into a single measure it may get messy and confusing for other users, so let’s step it out. We will need to create several measures to calculate the individual pieces the CAGR formula.  Of course, this is not the only way to calculate CAGR in Power Pivot, but this is the way we’ve decided to go about it.  So, let’s break it down, we will need the following measures to calculate CAGR: A measure to retrieve the First Year in the data set A measure to retrieve the Last Year in the data set A measure to calculate the Number of Years between the First and Last Years in the data set A measure to aggregate the total sales in the data set...

Useful Keyboard Shortcuts

Ctrl+1  to Format a Selection Ctrl+1  (the number one) works to format whatever is selected. Whether it is a cell, SmartArt, a picture, a shape, or the March data point in a column chart, press  Ctrl+1 . Ctrl[+Shift]+Arrow  to Navigate or Select Your cell pointer is sitting at the top of 50K rows of data, and you need to get to the bottom. If you have a column with no blanks, press  Ctrl+Down Arrow  to jump to the end of the data set. In the following figure,  Ctrl+Down Arrow  will jump to K545.  Ctrl+Left Arrow  will jump to A1.  Ctrl+Right Arrow  will jump the gap of empty cells and land on N1. Add the  Shift  key in order to select from the active cell to the landing cell. Starting from A1 in the above figure, press  Ctrl+Shift+Down Arrow  to select A1:A545. While still holding down  Ctrl+Shift , press the  Right Arrow  Key to select A1:K545. If it seems awkward at first, try it for a few d...

Vlookup to the Left with Index and Match function

What if your lookup value is to the right of the information that you want VLOOKUP to return? Conventional wisdom says VLOOKUP cannot handle a negative column number in order to go left of the key. One solution is  =VLOOKUP(I7,CHOOSE({1,2},G1:G5,F1:F5),2,0) . However, I prefer to use MATCH to find where the name is located and then use INDEX to return the correct value.