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
unkCandy
Helper I
Helper I

Group by and get all IDS while Filtering a table

Hello Community, 

 

I would like to get all IDS while filtering by code. 

I have a dataset that has: Code, ID, Number, key

unkCandy_0-1649838724649.png

  • there is a different Code for the same ID
  • the same ID has the same Key
  • And an ID has a consecutive number

I created a slicer to filter by a code but it gives only one row in ID:

unkCandy_1-1649839121472.png

 

I want a measure when you select a code you will get the whole list of the Ids. 

Outcome result: 

unkCandy_2-1649839177816.png

 

I see that way but it wont work for me: if (selectedvalue(data[code]) in (  the CODE of data[ID]), data[ID], 0) 

 

I had in my mind to create an additional table but my data model is quite big, I would prefer a measure. 
Thank you for reading. 

pbix: https://drive.google.com/file/d/10gIjeRmUIe2xLFNNEjihBk8Q02mER5Lg/view?usp=sharing

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @unkCandy 

 

You can try the following methods.

Table:

 

Table = VALUES(data[code])

 

Measure:

 

Measure = IF(SELECTEDVALUE(data[code]) in VALUES('Table'[code]),1,0)

 

Place the measure in the view with ID and set it equal to 1.

vzhangti_0-1651114939798.png

Is this similar to the result you expect?

Icey_0-1651823815631.png

 

 

Best Regards,

Community Support Team _Charlotte

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

10 REPLIES 10
v-zhangti
Community Support
Community Support

Hi, @unkCandy 

 

You can try the following methods.

Table:

 

Table = VALUES(data[code])

 

Measure:

 

Measure = IF(SELECTEDVALUE(data[code]) in VALUES('Table'[code]),1,0)

 

Place the measure in the view with ID and set it equal to 1.

vzhangti_0-1651114939798.png

Is this similar to the result you expect?

Icey_0-1651823815631.png

 

 

Best Regards,

Community Support Team _Charlotte

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

ribisht17
Super User
Super User

Hi UnkCandy,

 

I did not find the issue with a new table, as mentioned above you have a filter there, hence

Just don't summarise id and key and you should get the answer

ribisht17_1-1649840919883.png

 

 

 

Regards,

Ritesh

Hello thank you for your reply, what do you mean by not summarizing them? in the data fields? 

unkCandy_0-1649840786896.png

 

unkCandy
Helper I
Helper I

 

 

AntonioM
Solution Sage
Solution Sage

An additional table would work and you'd only need to keep the code and id columns. 

 

Then you'd link that to your original table on id, change the filter direction to be New table -> Original table and then use the 'New table'[code] in your slicer.

 

Now when you choose a code in the slicer, it filters your original table by that code's id

 

How big is your data model? Do you think that would that be too much to add in?

yes, I tried adding new table but it will make the data model more complicated. 

visheshjain
Solution Supplier
Solution Supplier

Hi @unkCandy ,

Not sure if I am missing anything but in the filter pane of the visual, you have the ID selected as 762.

If you remove that your report should work alright.

 

Please let me know if this helps and mark is as the solution so that others can reach the solution faster.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



Thank for your reply, for the filter, I just want to show what it is the outcome will be, when I selected a code I can get all IDS that has the selected code in their code. 

Hi @unkCandy ,

 

Please can you check the below screenshot, if this is the solution that you are looking for.

Screenshot (320).png

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



no it is not, I want to get all IDS if the code selected  is between the ID's code. 

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.