Forum Discussion

Patriklat's avatar
Patriklat
Regular Visitor
1 year ago
Solved

Multiple filtering in the measure

Hello everyone, i am trying to figure out one measure . 

 

How does it work - on KB 135 , workers are searching defect. If they found some - Product is going from KB 135 to 136 if there is direction "2" On KB 135 - given by worker . 

 

Once on KB 136 , Another worker will repair them . 

 

I want to know DAX measure - Show me , how many defects have John repaired .

 

Tables are joined by Body_ID . 

 

So basically 

 

I want to have measure that says : 

 

Count defects from table [defects] , where each entry of Body_ID is defect , but only if the defect was found on KB 135 . 

 

THen , count these defects and tell me , how many John Doe repaired . 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Patriklat ,

     

    Thanks for reaching out to our community.

    Based on your description, I think you want to count rows from defects group by names from loaded.

    Here's my solution.

    1.Create two columns, and then you can create a relationship between tables.

    2.Create a measure to count rows and create a table visual with the name field and the measure.

    As you can see, John Doe has 13 to repair.

    If my solution is incorrect, feel free to contact me~

     

     

    Best Regards,

    Stephen Tao

     

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

     

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Patriklat ,

    You can try something simillar to this:

    Defect Counter: CALCULATE(
                                    COUNT('Defects'[KB]),
                                    FILTER('Defects', [KB] = 135))
    John Doe Repairs: CALCULATE(
                                         COUNT('Loaded'[BodyID]),
                                          FILTER('Loaded', [Name] = "John Doe" &&
                                          [Direction] = 2)
                               )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Patriklat ,

     

    Thanks for reaching out to our community.

    Based on your description, I think you want to count rows from defects group by names from loaded.

    Here's my solution.

    1.Create two columns, and then you can create a relationship between tables.

    2.Create a measure to count rows and create a table visual with the name field and the measure.

    As you can see, John Doe has 13 to repair.

    If my solution is incorrect, feel free to contact me~

     

     

    Best Regards,

    Stephen Tao

     

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