top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

Power BI DAX: A Practical Guide to Turning Data into Insights

Aug 11
7 min read

Have you ever looked at a Power BI dashboard and wondered, “How did they calculate that?”


Behind many of those powerful numbers, KPIs, percentages, rankings, and comparisons is something called DAX.

DAX stands for Data Analysis Expressions, and it is one of the most important skills to learn when you want to move beyond simply creating charts in Power BI.

For women building or growing their careers in data analytics, business intelligence, reporting, or Power BI, learning DAX can be a real confidence booster. You don't need to memorize hundreds of formulas. You need to understand how DAX works and where to use it.


In this blog, let's understand DAX step by step with simple examples.

🌸 What Exactly Is DAX?

DAX is a formula language used in Power BI to create calculations from your data.

Think of it this way:

Your data → DAX calculation → Meaningful insight → Better decision

For example, suppose you have a sales dataset containing:

  • Product

  • Category

  • Sales

  • Quantity

  • Customer

  • Date

  • Region

You may want to answer questions such as:

  • What are my total sales?

  • What is the average sales amount?

  • Which product generated the highest revenue?

  • What percentage of sales came from each region?

  • How much did sales grow compared with last year?

  • What were sales during the previous month?

This is where DAX becomes useful.

Where Do We Write DAX?


Creating a new DAX measure in Power BI.

Image Shows: Power BI Desktop with the Modeling/Table Tools area and the “New measure” option highlighted. 

 

1. The Three Main Ways to Use DAX

Before writing formulas, it is important to understand that DAX is commonly used in three ways.

1. Calculated Columns

A calculated column creates a new column in your table.

For example, suppose you have a Sales column and a Quantity column.

You can calculate sales per unit:

Sales Per Unit = Sales[Sales] / Sales[Quantity]

The calculation is performed for each row.

When should you use a calculated column?

Use it when you need a value at the row level.

For example:

  • Categorizing customers

  • Creating age groups

  • Creating profit per transaction

  • Creating flags such as Yes/No

  • Creating custom categories

2. Measures — The Most Important Part of DAX

If you are serious about Power BI, measures are one of the most important DAX concepts to understand.

A measure calculates a value dynamically based on the context of your report.

For example:

Total Sales = SUM(Sales[Sales])

That's it!

This measure can then be used in cards, tables, charts, and other visuals.

The interesting part is that the result changes depending on what the user selects.

For example:

If the dashboard is filtered to:

Region = East

the measure shows East sales.

If the user changes the filter to:

Region = West

the same measure automatically shows West sales.

That's the power of DAX.


 Creating a simple Total Sales measure using SUM.


Image Shows: Creating a Total Sales Measure DAX formula bar with:

Total Sales = SUM(Sales[Sales])

Also show the measure appearing in the Fields/Data pane.


3. Calculating Average, Minimum and Maximum

DAX provides many functions for basic analysis.

For example:

Average Sales = AVERAGE(Sales[Sales])

To find the minimum:

Minimum Sales = MIN(Sales[Sales])

And the maximum:

Maximum Sales = MAX(Sales[Sales])

These simple measures can quickly help you understand the overall performance of your dataset.

For example, a dashboard could show:

Total Sales | Average Sales | Highest Sale | Lowest Sale

And suddenly, a simple dataset becomes much easier to understand.

4. Using DAX to Create Business Categories

DAX isn't only about adding numbers.

You can also use it to create meaningful categories.

Suppose you want to classify customers based on their sales.

You could create:

Customer Category =

IF(

    Sales[Sales] >= 10000,

    "High Value",

    "Regular"

)

Now your data contains a business-friendly classification.

You can use this category in charts and filters.

Why is this useful?

Because analysts are not just expected to calculate numbers.

We are expected to turn numbers into meaningful information.


Using the IF function to create meaningful categories.


Image Shows: Creating a Category Using IF DAX formula and the resulting category column with values such as “High Value” and “Regular.”


5. DAX and Percentage Calculations

One of the most common requirements in dashboards is calculating percentages.

For example, suppose you want to calculate what percentage of total sales comes from each region.

First, create your total sales measure:

Total Sales = SUM(Sales[Sales])

Then create:

Sales % =

DIVIDE(

    [Total Sales],

    CALCULATE(

        [Total Sales],

        ALL(Sales[Region])

    )

)

The DIVIDE() function is especially useful because it handles division safely.

Instead of simply writing:

A / B

you can use:

DIVIDE(A,B)

This helps avoid errors when the denominator is zero or blank.

6. CALCULATE — The DAX Function You Should Know

If there is one DAX function that deserves special attention, it is:

CALCULATE()

CALCULATE allows you to modify the filter context of a calculation.

For example:

East Sales =

CALCULATE(

    [Total Sales],

    Sales[Region] = "East"

)

This measure calculates sales specifically for the East region.

You can think of CALCULATE() as saying:

“Calculate this number, but under these conditions.”

This becomes extremely powerful when creating advanced Power BI dashboards.


Using CALCULATE to calculate sales for a specific region.


Image Shows: Using CALCULATE showing the formula.

East Sales =

CALCULATE(

    [Total Sales],

    Sales[Region] = "East"

)

 

7. Time Intelligence — Comparing Performance Over Time

This is another major use case for DAX.

Businesses rarely want to know only:

“How much did we sell?”

They usually want to know:

“Are we doing better than last month or last year?”

For example, you can calculate previous-year sales using:

Previous Year Sales =

CALCULATE(

    [Total Sales],

    SAMEPERIODLASTYEAR('Date'[Date])

)

Then calculate growth:

Sales Growth % =

DIVIDE(

    [Total Sales] - [Previous Year Sales],

    [Previous Year Sales]

)

Now you can create a dashboard showing:

Current Sales → Previous Year Sales → Growth %

This is much more useful for decision-making than displaying total sales alone.


 Using DAX for year-over-year performance analysis.


Image Shows: Year-over-Year Analysis showing a Power BI line chart with Date on the X-axis and Sales on the Y-axis, along with cards for Current Sales, Previous Year Sales, and Sales Growth %.

 

8. DAX Use Cases in Real-World Dashboards

Now let's look at where DAX is actually used.

📊 Sales Dashboards

DAX can help calculate:

  • Total revenue

  • Profit

  • Profit margin

  • Sales growth

  • Sales targets

  • Top-performing products

  • Regional performance

👩‍💼 HR Dashboards

DAX can help calculate:

  • Employee count

  • Attrition rate

  • Average tenure

  • New hires

  • Department-wise headcount

  • Employee turnover

💰 Finance Dashboards

DAX can be used for:

  • Revenue

  • Expenses

  • Profit

  • Budget vs Actual

  • Variance

  • Financial growth

📈 Marketing Dashboards

DAX can help calculate:

  • Conversion rate

  • Campaign performance

  • Customer acquisition

  • Marketing ROI

  • Leads generated

  • Cost per lead

🏥 Healthcare Dashboards

DAX can support:

  • Patient counts

  • Average length of stay

  • Readmission rates

  • Patient outcomes

  • Department performance

The possibilities are much broader than simply calculating totals.

9. DAX vs Excel Formulas

If you already know Excel formulas, you may wonder:

“Why should I learn DAX?”

There are similarities, but they work differently.

Excel formulas generally calculate based on cells and ranges.

DAX is designed to work with tables, relationships, filters, and report context.

For example, Excel users might be familiar with:

SUM()

IF()

AVERAGE()

DAX also has these functions.

But DAX goes much further with functions such as:

CALCULATE()

FILTER()

ALL()

RELATED()

SUMX()

SAMEPERIODLASTYEAR()

The key difference is that DAX is designed specifically for data models and analytical reporting.

10. A Simple DAX Learning Path for Beginners

If you're just starting, don't try to learn everything at once.

Follow this order:

Step 1 — Learn basic aggregation

Start with:

SUM

AVERAGE

MIN

MAX

COUNT

DISTINCTCOUNT

Step 2 — Learn logical functions

Then learn:

IF

SWITCH

AND

OR

Step 3 — Learn filter functions

Next:

CALCULATE

FILTER

ALL

Step 4 — Learn iterator functions

Move into:

SUMX

AVERAGEX

COUNTX

Step 5 — Learn time intelligence

Finally, practice:

DATEADD

SAMEPERIODLASTYEAR

TOTALYTD

TOTALMTD

This approach is much easier than trying to memorize DAX functions randomly.

11. One Important Tip: Don't Just Memorize DAX

This is probably the biggest lesson I would share with anyone learning Power BI.

Don't learn DAX by memorizing formulas.

Instead, ask:

“What question am I trying to answer?”

For example:

Question: What are my total sales?

→ SUM()

Question: What are sales for a particular region?

→ CALCULATE()

Question: What percentage of total sales comes from each category?

→ DIVIDE() + CALCULATE()

Question: How did sales change from last year?

→ Time intelligence functions

When you start thinking in terms of business questions, DAX becomes much easier.

🌷 Why DAX Is a Valuable Skill for Women in Data

For women who are entering data analytics, returning to the workforce, changing careers, or looking to move into a more technical role, Power BI can be a great skill to add to your toolkit.

And you don't need to become an expert overnight.

Start with one dataset.

Create one measure.

Build one visual.

Then ask one more business question.

Slowly, those small steps build confidence.

Technical skills grow through practice, not perfection.

Whether you're working full-time, managing family responsibilities, restarting your career, or simply learning something new, remember that your learning journey doesn't have to look like anyone else's.

Your goal is not to know every DAX function.

Your goal is to understand how data can answer real questions.

Final Thoughts

DAX is much more than a collection of Power BI formulas.

It is a way of turning raw data into useful, dynamic, and meaningful insights.

Start with simple calculations such as:

Total Sales = SUM(Sales[Sales])

Then gradually move toward:

  • Conditional calculations

  • Percentage analysis

  • CALCULATE()

  • Filter context

  • Time intelligence

  • Business KPIs

The more you practice with real-world questions, the more natural DAX will become.

And remember:

You don't need to know everything to start. You just need to start learning one calculation at a time. 🌸

If you're learning Power BI right now, open your Power BI Desktop and create your first measure today.

One measure today can become one powerful dashboard tomorrow.


Thank you so much for taking the time to read my blog! I truly appreciate your support and interest in my content.



 


 
 

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page