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
Anonymous
Not applicable

How can I calculate averages for only those answers which appear in both tables?

Suppose that I have the following four tables of data in Power BI:

 

Table 1.

NameCountryAgePoints
KarlGermany145
ElenaGermany155
AnneGermany1310
KalleSweden1315
PelleSweden1220
GloriaSpain1110

 

Table 2.

CodeHobbyHobby type
1FootballSport

2

BasketballSport
3PianoMusic
4ViolinMusic

 

Table 3.

NameHobby of interest (code)
Karl1
Elena1
Anne1
Kalle2
Pelle4
Gloria3

 

Table 4.

NameHobby (code)
Karl1
Anne1
Gloria3

 

  • So in tables 3 and 4, the hobbies and hobbies of interest are coded with numbers 1, 2, 3 and 4.
  • Some of the people are only interested (table 3) in a specific hobby, some both are interested and practice (table 4) that hobby. 

I want to build a table visualisation based on this data.

  • I want to consider only German people (names from Table 1, where Country = Germany).
  • I want to have two slicers on the same page of my report: one for hobby type (sport/music) and one for hobby (football/basketball/violin/piano; not hobby of interest).
  • Then the table shows the average age and average points for those German people who have the given hobby and/or their hobby is in the given hobby type

For example, if I chose hobby type = sport, then the averages would be calculated for German people, who have a hobby of type Sport, that is, football or basketball. Thus, the averages are calculated for Karl and Anne. The resulting table visualisation would be:

Average ageAverage points
13.57.5

 

But how could I do this table visualisation? There is a connection between people names in different tables, and connection between hobbies and their codes. I need to be sure that the resulting table is calculated only for people with a given hobby (and/or hobby type), not for every person interested in a given hobby.

3 REPLIES 3
lbendlin
Super User
Super User

Since Table 3 doesn't seem to play a role in your question you can ignore that.  Your other filters can be done with standard Power BI Desktop functionality.  What have you tried and where are you stuck?

Anonymous
Not applicable

When I create a slicer with hobbies (football, basketball, piano, violin), I cannot be sure whether it filters based on hobby or hobby of interest. 

Read about ISFILTERED and FILTERS functions.

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