Forum Discussion

BicBiro's avatar
BicBiro
New Member
1 year ago
Solved

Filtering help

Hey all,  I'm hoping you can help - I have some data - which shows users from which groups who have used some tools, I want to understand which groups of users have used multiple tools so that I can...
  • DataNinja777's avatar
    1 year ago

    Hi BicBiro ,

     

    You can accomplish this in DAX by creating a new Calculated Table. This approach generates a filtered version of your data based on the multi-step logic you need: first finding the groups that use a specific tool, and then showing all data for those groups.

    Here is the DAX expression you would use. Simply replace 'YourTable' with the name of your actual data table and "Tool Y" with the specific tool you wish to filter by.

    FilteredTable = 
    VAR TargetGroups =
        CALCULATETABLE (
            VALUES ( 'YourTable'[GROUP] ),
            'YourTable'[TOOL] = "Tool Y"
        )
    RETURN
        FILTER (
            'YourTable',
            'YourTable'[GROUP] IN TargetGroups
        )

    This DAX code works by first creating a temporary variable named TargetGroups. This variable holds a distinct list of all groups that have at least one entry associated with "Tool Y". The RETURN statement then executes the main logic, which iterates through your original table and keeps only the rows where the group name is found within the TargetGroups list created in the first step. The result is a new table in your data model that contains the complete tool usage for only the groups that meet your criteria.

     

    Best regards,