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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pan_Forex
Helper III
Helper III

difference of two averages and 2 slicers

Hey guys, I have a problem counting the difference of two averages. I keep getting a result of 0 despite filtering the data. I have a table that looks like this:

Player   Score   Player2   

Score2   

     A   8   A   8
     B   7   B   7
     C   6   C   6
     D   8   D   8

 

I simply added two additional columns to use them separately in the slicer, unfortunately it doesn't work 😀 

My visualization:

 

 avg.png

TEAM I and TEAM II are averages of selected players. I would like Team_results to count the difference in averages between teams after selecting players on both sides. 

Team_results = AVERAGE('Table'[Score])-(AVERAGE('Table'[Score2]))
the result I would like to achieve after selected players A, B in TEAM I and C, D in TEAM II. Average Team I=7.5, Average Team II=7. Team I - TEAM II= 0.5 

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Linking both slicers to the same table won't work, you need to create two new tables for the slicers, like

Team I = DISTINCT('Table'[Player])

Link both Team I and Team II to your existing table and use the player column from the new tables on the slicer.

You can then create measures like

Team I Avg =
CALCULATE ( AVERAGE ( 'Table'[Score] ), REMOVEFILTERS ( 'Team II' ) )


Team II Avg =
CALCULATE ( AVERAGE ( 'Table'[Score] ), REMOVEFILTERS ( 'Team I' ) )

Team results = [Team I Avg] - [Team II Avg]

View solution in original post

2 REPLIES 2
Pan_Forex
Helper III
Helper III

Thank you very much for your time and help 🙂

johnt75
Super User
Super User

Linking both slicers to the same table won't work, you need to create two new tables for the slicers, like

Team I = DISTINCT('Table'[Player])

Link both Team I and Team II to your existing table and use the player column from the new tables on the slicer.

You can then create measures like

Team I Avg =
CALCULATE ( AVERAGE ( 'Table'[Score] ), REMOVEFILTERS ( 'Team II' ) )


Team II Avg =
CALCULATE ( AVERAGE ( 'Table'[Score] ), REMOVEFILTERS ( 'Team I' ) )

Team results = [Team I Avg] - [Team II Avg]

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors