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

Get all items of a specificized value

I have a dataset of items that have a grouping. A sample of this data is in the following table:

 

ItemGroupng ID
1AGrp - 1 -24
1BGrp - 1 -24
1BGrp - 1 -24
2AGrp - 1 -24
1AGrp - 2 -24
2AGrp - 2 -24
4AGrp - 2 -24
18AGrp - 2 -24
5AGrp - 3 - 24
5CGrp - 3 - 24
5DGrp - 3 - 24
X5Grp - 3 - 24
5BGrp - 4 - 24
5DGrp - 4 - 24
5DGrp - 4 - 24
X5Grp - 4 - 24
X5Grp - 4 - 24
1BGrp - 5 - 24
5DGrp - 5 - 24
5CGrp - 5 - 24
5BGrp - 5 - 24
1CGrp - 5 - 24
X5Grp - 5 - 24

 

What I am looking to do is select an item via a slicer and then get back all the items in all the groups that the selected items appears in.  For Example if I select X5, I would get the all the items from the groups Grp - 3 -24, Grp - 4 -24, and Grp - 5 -24. I am looking to count the items, find percentages, etc with the returned data.

 

How would I go about getting this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello,hnguy71 and Ashish_Mathur ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@MichaelRensing .I am glad to help you.

Like this?
By implementing the effect of the slicer's reverse selection of data you can achieve what you want: generate a selection table based on the multiple (single values) selected in the slicer. Display them in the table. Also calculate the corresponding quantities (total or grouped counts (based on Grouping ID))

Control the filtering results through measure, instead of using slicer directly.

vjtianmsft_0-1731485270164.png

I hope you find my tests useful.
this is my test data.

vjtianmsft_1-1731485357090.png

1. Re-create a table that does not build relationships, but is only used to pass slicer options

vjtianmsft_2-1731485385619.png

The slicer here only passes values without any filtering effect (so no need to create a relationship)

vjtianmsft_3-1731485454255.png

vjtianmsft_5-1731485528049.png

Create a measure that acts as a reverse filter (supports slicer multi-selection).

vjtianmsft_6-1731485574305.png

Set visuals to be filtered by measure and only display data that satisfies [M_choose]=1

 

vjtianmsft_8-1731485690874.png

Calculate the total number of filtered data

M_CountALLSelected = CALCULATE(COUNT('TestData'[Item]),FILTER(ALL(TestData),[M_choose]=1))

Calculate the number of filtered data grouped by [Gourping ID].

M_CountByGroup = 
VAR _groupID=MAX('TestData'[Groupng ID])
RETURN
CALCULATE(COUNT('TestData'[Item]),FILTER(ALL(TestData),[M_choose]=1 &&'TestData'[Groupng ID]=_groupID))


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hello,hnguy71 and Ashish_Mathur ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@MichaelRensing .I am glad to help you.

Like this?
By implementing the effect of the slicer's reverse selection of data you can achieve what you want: generate a selection table based on the multiple (single values) selected in the slicer. Display them in the table. Also calculate the corresponding quantities (total or grouped counts (based on Grouping ID))

Control the filtering results through measure, instead of using slicer directly.

vjtianmsft_0-1731485270164.png

I hope you find my tests useful.
this is my test data.

vjtianmsft_1-1731485357090.png

1. Re-create a table that does not build relationships, but is only used to pass slicer options

vjtianmsft_2-1731485385619.png

The slicer here only passes values without any filtering effect (so no need to create a relationship)

vjtianmsft_3-1731485454255.png

vjtianmsft_5-1731485528049.png

Create a measure that acts as a reverse filter (supports slicer multi-selection).

vjtianmsft_6-1731485574305.png

Set visuals to be filtered by measure and only display data that satisfies [M_choose]=1

 

vjtianmsft_8-1731485690874.png

Calculate the total number of filtered data

M_CountALLSelected = CALCULATE(COUNT('TestData'[Item]),FILTER(ALL(TestData),[M_choose]=1))

Calculate the number of filtered data grouped by [Gourping ID].

M_CountByGroup = 
VAR _groupID=MAX('TestData'[Groupng ID])
RETURN
CALCULATE(COUNT('TestData'[Item]),FILTER(ALL(TestData),[M_choose]=1 &&'TestData'[Groupng ID]=_groupID))


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


Ashish_Mathur
Super User
Super User

Hi,

I have answered a similar question in the attached file.

Hope this helps.


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

@hnguy71 
This would only give me the X5 Items.  I would like to get ALL items in the Grouping ID.  So It would give me back all of Grp - 3 -24, Grp - 4 - 24, and Grp - 5 -24.  Any group that X5 shows in, not just the X5s

Hi @MichaelRensing 

Then you would need an additional step to remove the filter context from the item selected. Create a measure:

 

GroupCount = CALCULATE(COUNTA(YOUR_TABLE[Groupng ID]), REMOVEFILTERS(YOUR_TABLE[Item]))

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@hnguy71 I tried this and am still not getting what I am expecting. With none selected, the count is 23, selecting 4A, I was expecting a result of 4, but still seeing 23.

 

And the measuer for Group Count is 

Group Count = CALCULATE(COUNTA('Sheet1'[Groupng ID]), REMOVEFILTERS(Sheet1[Item]))


Screenshot 2024-11-09 141301.pngScreenshot 2024-11-09 141324.png

Hi @MichaelRensing ,

So in this case, you want to add back some filter criteria. To get the corrected "totals", you would need to use SUMX against your total.

This should work:

Group.Count = 
VAR _Tbl = SUMMARIZE(YOUR_TABLE, YOUR_TABLE[Groupng ID], "@Group", CALCULATE(COUNTA(YOUR_TABLE[Groupng ID]), REMOVEFILTERS(YOUR_TABLE[Item])) )
RETURN
SUMX(_Tbl, [@Group])


This should be your expected results:

hnguy71_0-1731193544949.png

 





Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
hnguy71
Super User
Super User

Hi @MichaelRensing,
Using a basic slicer would the the trick for you.

hnguy71_0-1731166406260.png

Then you would use a basic measure for your count, similarly to this:

 

Item.Count = COUNTROWS(YOUR_TABLE)

 





Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.