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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JDartz
Regular Visitor

Calculate Average of Column with Two Filters

Hey, everyone! 

Brand new to Power BI; tired looking for this solution but can't seem to find it.

 

Basicially I'm trying to create an avearge measure of a specific column, but with two filters engaged for the same column. 

I have been able to calculate the Average in that column for ONE filter, but can't seem to figure out how to calculate for two filters. Here is the formula for the one filter calculation that works:

AVG TX IO =

CALCULATE (
    AVERAGE ( '2024 Raw Data (2)'[TX] ),
    FILTER ( '2024 Raw Data (2)', '2024 Raw Data (2)'[ Location] = "In-Office" )
)
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Modify the measure to

AVG TX IO = CALCULATE(AVERAGE ( '2024 Raw Data (2)'[TX] ),'2024 Raw Data (2)'[ Location] = "In-Office"||'2024 Raw Data (2)'[ Location] = "Out-Office")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Modify the measure to

AVG TX IO = CALCULATE(AVERAGE ( '2024 Raw Data (2)'[TX] ),'2024 Raw Data (2)'[ Location] = "In-Office"||'2024 Raw Data (2)'[ Location] = "Out-Office")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Yes! Taking the FILTER function out and adding || worked! Much appreciated!!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

maybe try to use && to apply the second fileter

AVG TX IO =

CALCULATE (
    AVERAGE ( '2024 Raw Data (2)'[TX] ),
    FILTER ( '2024 Raw Data (2)''2024 Raw Data (2)'[ Location] = "In-Office"  && xxxx )
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.