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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
davidmorgan_pia
New Member

How to make a comparison to the rest when multiple filters?

Hi,

This is my first post.

 

I have a fact table with student enrolment data similar to:

 

AgentEnabledStudentUnitGPAYear
A1YS1U142023
A1YS1U232023
A1YS1U332023
A1YS1U442023
A2YS2U142023
A2YS2U232023
A2YS2U332023
A2YS2U442023
A2YS3U502023
A2YS3U602023
A2YS3U702023
A2YS3U802023
A3NS4U132023
A3NS4U332023
A3NS4U632023
A3NS4U832023

 

There are a number of slicers that may choose the year, the enabled status and the agent. The agent slicer is based on a Dimension table which has the Agent information and is related to the fact table.

 

When an Agent is selected there needs to be a comparison of the weighted average GPA for the Agent's students and "the rest" of the agents. If the slicers have filtered the enabled status or the year this must be kept on "the rest".

 

For example if the Agent A1 was selected its GPA will be 3.5 ((4+3+3+4)/4 = 14/4) and the rest should be 2.16 ((4+3+3+4+0+0+0+0+3+3+3+3)/12). If Agent A2 was selected and the enabled was selected the A2 GPA should be 1.75 (4+3+3+4+0+0+0+0)/8) and for the rest it should be 3.5 ((4+3+3+4)/4)

 

I can not figure out how to ensure "the rest" has the same filters applied to it (year, enabled) as selected in the slicers except the agent slicer.

 

Any help as to how to tackle this will be appreciated as I need to make lots of comparisons of a chosen sliced value against the rest.

 

 

4 REPLIES 4
sanalytics
Super User
Super User

Hello @davidmorgan_pia 
you can refer my solution also.
Attached pbix file

https://we.tl/t-VY0oO5G8cc

 

Regards

sanalytics

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1735646480211.png

 


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

@davidmorgan_pia 

you can try to create a agent table for filtering

Table 2 = DISTINCT('Table'[Agent])
 
selected = AVERAGEX(FILTER('Table','Table'[Agent]=max('Table 2'[Agent])),'Table'[GPA])
 
rest = AVERAGEX(FILTER('Table','Table'[Agent] <>max('Table 2'[Agent])),'Table'[GPA])
 
11.PNG
 
pls see the attachment below




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

Proud to be a Super User!




audreygerred
Super User
Super User

Hi! To do this you will create two measures. First measure:

Selected Agent GPA =
IF(
HASONEVALUE('Table'[Agent),
AVERAGE('Table'[GPA]),
BLANK()
)

 

Second measure:

Average GPA Excluding Selected Agent=
CALCULATE(
AVERAGE(Table[GPA]),
REMOVEFILTERS(Table[Agent]),
Table[Agent] <> VALUES(Table[Agent])
)

 

Here are some examples:

audreygerred_0-1735572542173.png

 

audreygerred_1-1735572564236.pngaudreygerred_2-1735572591976.png

 

 

 





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

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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