Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Mike91
Helper I
Helper I

average year sales

Hi All,

i need your help to calculate the average sales during fyscal year for each item, for example item A sold 1000 euro in 12 month, average 83,33 euro, how i can divide the total sales for the month where the item sold? 

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

 

To calculate the average sales per month during a fiscal year in Power BI, but only for the months where the item actually had sales, you can use a DAX measure. This measure will:

  1. Calculate the total sales for the fiscal year.
  2. Count the number of months where there were sales for that item.
  3. Divide the total sales by the number of months with sales.

Here’s how you can write the DAX measure:

Steps:

  1. Total Sales: Sum the sales for the item.
  2. Number of Months with Sales: Count the distinct months where sales occurred.
  3. Average Sales Per Month: Divide the total sales by the count of months with sales.

DAX Formula:

DAX
Copy code
Average Sales Per Month = VAR SalesMonths = CALCULATE( COUNTROWS( DISTINCT(Sales[Month]) ), Sales[Total Sales] > 0 -- Only count months where there were sales ) VAR TotalSales = SUM(Sales[Total Sales]) -- Total sales of the item RETURN IF( SalesMonths > 0, TotalSales / SalesMonths, -- Calculate average if there are sales months 0 -- Return 0 if there were no sales )

 

View solution in original post

3 REPLIES 3
Mike91
Helper I
Helper I

Thanks a lot for your help 🙂 all works

 

123abc
Community Champion
Community Champion

 

To calculate the average sales per month during a fiscal year in Power BI, but only for the months where the item actually had sales, you can use a DAX measure. This measure will:

  1. Calculate the total sales for the fiscal year.
  2. Count the number of months where there were sales for that item.
  3. Divide the total sales by the number of months with sales.

Here’s how you can write the DAX measure:

Steps:

  1. Total Sales: Sum the sales for the item.
  2. Number of Months with Sales: Count the distinct months where sales occurred.
  3. Average Sales Per Month: Divide the total sales by the count of months with sales.

DAX Formula:

DAX
Copy code
Average Sales Per Month = VAR SalesMonths = CALCULATE( COUNTROWS( DISTINCT(Sales[Month]) ), Sales[Total Sales] > 0 -- Only count months where there were sales ) VAR TotalSales = SUM(Sales[Total Sales]) -- Total sales of the item RETURN IF( SalesMonths > 0, TotalSales / SalesMonths, -- Calculate average if there are sales months 0 -- Return 0 if there were no sales )

 

123abc
Community Champion
Community Champion

 

To calculate the average sales per month during a fiscal year in Power BI, but only for the months where the item actually had sales, you can use a DAX measure. This measure will:

  1. Calculate the total sales for the fiscal year.
  2. Count the number of months where there were sales for that item.
  3. Divide the total sales by the number of months with sales.

Here’s how you can write the DAX measure:

Steps:

  1. Total Sales: Sum the sales for the item.
  2. Number of Months with Sales: Count the distinct months where sales occurred.
  3. Average Sales Per Month: Divide the total sales by the count of months with sales.

DAX Formula:

DAX
Copy code
Average Sales Per Month = VAR SalesMonths = CALCULATE( COUNTROWS( DISTINCT(Sales[Month]) ), Sales[Total Sales] > 0 -- Only count months where there were sales ) VAR TotalSales = SUM(Sales[Total Sales]) -- Total sales of the item RETURN IF( SalesMonths > 0, TotalSales / SalesMonths, -- Calculate average if there are sales months 0 -- Return 0 if there were no sales )

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.