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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
displaced
New Member

Filter participant counts

Hi,

 

I've hit a stubling block which I cant quite figure out.

 

I'm using power query to manipulate various sources of data.  several tables each covering a year of particiapnt data from 3 distinct sources.  I roll these into one sheet covering all years per source and the roll that into one overall sheet called Master Participant.  This now includes all participants from all years from all sources.  I've merged into this table, location info based on the particiapnt address

 

I wasnt interested in the detail of these sheet as I only wanted a count per location.  So I've removed all other columns and grouped by location to get a count of rows per location.  Giving me a count of particiapnts per location. Great!!

 

What has now been asked for is to be able to filter within the powerbi dashboard based on the 3 original distinct sources.  But when i added a filter with the source column from the orignal table, it doesnt filter my master participant table as there is no relationship in play.  The source column is no longer available in the Master participant table.  I cant work out how to create a relationship.

 

What am i missing here ??? 

6 REPLIES 6
v-sgandrathi
Community Support
Community Support

Hi @displaced,

 

The issue arises because grouping in Power Query changes the data grain to just Location, which removes details like Source and blocks filter context in the model. Keeping the Master Participant table at the participant level and not pre-aggregating preserves all columns such as Source, Year, and Location. This allows Power BI relationships and slicers to function as intended. You can then use a DAX measure like COUNTROWS('Master Participant') to calculate participant counts dynamically. This method follows best-practice modeling, keeps your model flexible, and ensures filters like Source work automatically without needing to redesign the data model.

 

Thank you.

Hi @displaced,

 

Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?

If you still have any questions or need more support, please feel free to let us know. 

We are more than happy to continue to help you.

displaced
New Member

Thank all,

@v-sgandrathi @cengizhanarslan @BA_Pete 

 

Really appreciate your very detailed and thought through explanations, it has made it clear how I have created this problem and steps I can take to fix it.  

 

I think in my example, reworking the model is the best way forward rather than any work arounds.  So keeping the grain of the source and the working with DAX later to get the totals.

 

Much appreciated. 

 

 

 

v-sgandrathi
Community Support
Community Support

Hi @displaced,

Thank you @cengizhanarslan @BA_Pete for your prompt replies to the  query.

Another concept that explains why this occurs is that grouping in Power Query changes the grain of your data. After aggregating the table to just Location, attributes at a more detailed level, such as Source, are no longer available, which prevents Power BI from creating relationships or passing filter context.

If you need to keep the pre-aggregated table for performance or model size reasons, there are two advanced options:

  • Create a bridge table with [Location, Source] grain and link both the grouped table and a Source dimension to it. This keeps filter flow intact without duplicating participant-level data.
  • Use a disconnected slicer and TREATAS in a measure to apply the selected Source to the aggregated table. This is useful when you can't remodel, but it's more complex and harder to maintain.

While these solutions are available, they are workarounds. The best approach is to keep data at participant grain and use DAX for aggregation, making future slicing easier without needing to redesign the model.

 

Thank  you.

cengizhanarslan
Super User
Super User

1) Keep the detail table

Your Master Participant table should stay at participant grain, e.g.:

ParticipantID | Location | Source | Year | …

 

2) Create the count using a DAX measure

Instead of grouping in Power Query, create a measure:

Participant Count =
COUNTROWS ( 'Master Participant' )

 

Put:

  • Location on rows (table / map / matrix)

  • Participant Count as the value

  • Source as a slicer

Now filtering works automatically, because:

  • Source still exists

  • Filter context flows into the measure

  • The count is recalculated dynamically

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
BA_Pete
Super User
Super User

Hi @displaced ,

 

I think there's a couple of options here:

-1- Retain the source column in your Master Participant table by doing the final Group By on [Source] and [Location].

-2- Don't do the final Group By at all and just send the granular appended table to the model and calculate whatever you need using measures over the full table. This one also future-proofs against the new requirements you'll get tomorrow, and the next day, etc.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.