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

Grouping data and identifying which records belong to each group for filtering

Hi,

My dataset is shown below:

Account_idTransaction_idproduct_code
111111549003ABC123001-123
111222549003ABC123001-123
111333549003ABC123001-124
111444549123ABC789001-789
123456549123ABC789001-345
234567549002DEF001001-001
345678549089GHF500001-501
543215549089GHF500001-501
987654549089GHF500001-500
876543549089GHF500001-500
765432549089GHF500001-560
654321666999WTF005001-005
123987666999WTF005001-200
567890800812WTF456001-456
908123800812WTF456001-777

I have grouped my data based on the "transaction_id" column, I have then done a distinct count on the "product_code" for each "transaction_id" group and then a count on the "account_id" that belongs to each product code after grouping by transaction_id. See below of this new table:

Goku100_1-1624880968391.png

I can then filter this grouped table based on the distinct count "product_code" e.g. if distinct count is greater than 1. This will allow me to identify which accounts fall in this category, see below:

Goku100_2-1624881023925.png

 

For the visuals I create after this, I only want to look at these specific accounts that have been identified from the grouping and filter above. How can I achieve this "on page" filter?

 

Do I need to create a new calculated column which assigns a value to each row that has been identified to meet this criteria? not sure how to do this, any help is appreciated. 

 

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Only the column can be add to page level. But it don't apply aggregation of the column value. So you need to create calculated column to use as page level filter. 

 

countpc = CALCULATE(DISTINCTCOUNT('Table'[product_code]),ALLEXCEPT('Table','Table'[Transaction_id])) 

 

Put it in page-level filter.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

View solution in original post

1 REPLY 1
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

Only the column can be add to page level. But it don't apply aggregation of the column value. So you need to create calculated column to use as page level filter. 

 

countpc = CALCULATE(DISTINCTCOUNT('Table'[product_code]),ALLEXCEPT('Table','Table'[Transaction_id])) 

 

Put it in page-level filter.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

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.