Forum Discussion

MichaelRensing's avatar
1 year ago
Solved

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:   Item Groupng ID 1A Grp - 1 -24 1B Grp - 1 -24 1B Grp - 1 -24 2A Grp - 1 -24 ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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.

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

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

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

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

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

     

    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.