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
SevsBo
Helper V
Helper V

Compare total average to per-row average?

We're trying to show how items in ColumnA compare against the average for all of the items, then to calculate actual and percentage-based difference to find the biggest outliers. This is shown in a table that has multiple columns from Table1 and Table2, some of which should continue to filter the end result, but not all.

 

The regular AVERAGE approach doesn't work as that is influenced by each row, so I think we need to use REMOVEFILTERS to prevent row-level filtering, but the issue is that we also have to re-add a large number of filters to get to the correct average number.

 

The page is using 11 filters, some of which have multiple selections, so the current solution looks like this:

 

Average_removed_filters =
CALCULATE(
AVERAGE(Table1[numbers]),
REMOVEFILTERS(Table1),
REMOVEFILTERS(Table2), --data for table visual comes from these two tables
Table1[ColumnB] = ...,
Table1{ColumnC] = ...,

. . .

Table2[ColumnA] = ...,

Table2[ColumnB] = ...
)

 

Only there are a lot of criteria to go through, which will make the whole DAX quite fragile if any of those filters change on a page level.

 

Is there a better way to do a calculation of AVERAGE across all items that can be shown on a page, and of row-based AVERAGE, that we can compare with the first?

1 ACCEPTED SOLUTION

Issue was resolved by creating a calculated table based on the Page-level filters, and calculating relevant averages within that table. This is was then used in measures within the existing tables to derive variance between row-calculated averages and absolute averages for the data.

View solution in original post

6 REPLIES 6
v-dineshya
Community Support
Community Support

Hi @SevsBo ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @amitchandak , @Ashish_Mathur , Thanks for your prompt response.

 

Hi @SevsBo , If @amitchandak , @Ashish_Mathur  responses has resolved your query, Please mark their responses as  "Accept as solution" , to assist other community members in resolving similar issues more efficiently.

Regards,

Dinesh

Ashish_Mathur
Super User
Super User

Hi,

If the number of columns to be retained are lesser than the ones which need to be cleared, then consider using the ALLEXCEPT() function.


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

I have tried that, using ALLEXCEPT on the two tables that filter the results on page-level, but the issue is some of those are also included in the actual table visual, so they filter the AVERAGE calculation to a single item.

Hi @SevsBo ,

Thank you for reaching out to the Microsoft Community Forum.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot). Do not include sensitive information. Do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided.


Regards,
Dinesh

Issue was resolved by creating a calculated table based on the Page-level filters, and calculating relevant averages within that table. This is was then used in measures within the existing tables to derive variance between row-calculated averages and absolute averages for the data.

amitchandak
Super User
Super User

@SevsBo , Please see if visual calculations can help. That can do this easily 

 

Visual Calculations in Power BI- February 2024 Update RUNNINGSUM, RANGE, MOVINGAVERAGE, COLLAPSE, COLLAPSEALL, EXPAND, EXPANDALL, FIRST, LAST, PREVIOUS, and NEXT
https://www.youtube.com/watch?v=bKD9T0EWgQo&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors