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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SecretChimpanze
Frequent Visitor

Calculated measure to get an average with filters

Hi,

 

I am looking for a solution to get the average of historical data based on a multiple criteria.

 

Example of what I would use if I were doing it in Excel:

=AVERAGEIFS(average_range,criteria_range_1,"Actual",criteria_range_2,"Week x")

 

Week x would be either Week 0, Week 1 or Week 2

 

Launch WeekWeek EndingActual/ForecastSales Volume
Week 02-Jun-23Actual1000
Week 19-Jun-23Actual1500
Week 216-Jun-23Actual2000
 23-Jun-23Actual800
 30-Jun-23Actual800
 7-Jul-23Actual800
Week 014-Jul-23Actual3000
Week 121-Jul-23Actual3500
Week 228-Jul-23Actual4000
 4-Aug-23Actual800
 11-Aug-23Actual800
 18-Aug-23Actual800
Week 025-Aug-23Forecast2000
Week 11-Sep-23Forecast2500
Week 28-Sep-23Forecast3000

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SecretChimpanze ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1708675766834.png

Create a measure

 

Average Sales Volume = 
    CALCULATE(
        AVERAGE(SalesData[Sales Volume]),
        FILTER(
            SalesData,
            SalesData[Actual/Forecast] = "Actual" &&
            (SalesData[Launch Week] = "Week 0" || SalesData[Launch Week]= "Week 1" || SalesData[Launch Week] = "Week 2")
        )
    )

 

Final output

vheqmsft_2-1708676325263.png

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @SecretChimpanze ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1708675766834.png

Create a measure

 

Average Sales Volume = 
    CALCULATE(
        AVERAGE(SalesData[Sales Volume]),
        FILTER(
            SalesData,
            SalesData[Actual/Forecast] = "Actual" &&
            (SalesData[Launch Week] = "Week 0" || SalesData[Launch Week]= "Week 1" || SalesData[Launch Week] = "Week 2")
        )
    )

 

Final output

vheqmsft_2-1708676325263.png

Best regards,

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

lbendlin
Super User
Super User

You talk about prior years but your sample data does not reflect that. In addition, time intelligence functions have no concept of "week".  That is something you need to bring to the table yourself.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.