Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

How to Calculate Current Month and Previous Month Sales in Power BI?

Power BI can be quite useful when we are working on dates. It has some powerful built-in formulas that allow you to do calculations based on dates.

One common scenario where you have to perform calculations with dates would be to find out how to calculate monthly sales.

In this tutorial, we will learn how to calculate current month and previous month sales in Power BI with different examples.

How to Calculate Current Month Sales in Power BI

This example shows how to calculate current month sales in Power BI.

Let’s consider a simple scenario:

You manage a small bakery and want to analyze your monthly sales performance in Power BI to track how your bakery is doing over time.

Specifically, you want to compare the current month’s sales with the previous month to understand trends and decide about the market.

According to this scenario, we have an Excel file named SweetDelights_Sales_2024 that contains the Date and Sales Amount column. Check the screenshot below.

current month sales in power bi

Now follow the below steps to calculate the current month’s sales:

1. Open Power BI Desktop and load data using the Get data option. Then, you can see data in the Data pane.

current month dax in power bi

2. Under the Home tab, click New measure.

calculate current month sales in power bi

3. In the formula bar, Put the below expression. Then click Commit.

Current Month Sales = 
CALCULATE(
		SUM('SalesData2024'[Sales Amount]),
		FILTER(
			'SalesData2024',
			MONTH('SalesData2024'[Date]) = MONTH(TODAY())
		)
	)

Where:

  • Current Month Sales = This is the name we give to our measure. It represents the Current Month’s sales.
  • CALCULATE() = It’s like telling Power BI to calculate based on certain conditions or filters.
  • SUM(‘SalesData2024′[Sales Amount]) = This calculates the total sum of sales amounts from the SalesData2024 table.
  • FILTER = It’s like applying a condition to select specific rows or data from a table.
  • MONTH(‘SalesData2024′[Date]) = This extracts the month component from the date column in the SalesData2024 table.
  • MONTH(TODAY()) = This gets the current month from today’s date.
current month power bi

4. After that, Under the Home tab, expand Visual gallery(black box) -> Click the Table visual.

current month in power bi dax

5. Then, using the +Add data option, add Date, Sales Amount, and Current Month Sales into the Column field.

how to get current month sales in power bi

6. After that, you’ll notice that only the February month data is displayed in the “Current Month Sales” because I’m implementing it in February.

how to calculate current month sales in power bi

This way, you can calculate current month sales in Power BI.

Calculate Previous Month Sales in Power BI

This example shows how to calculate the previous month’s sales in Power BI.

1. Under the Home tab, click New measure.