Forum Discussion

MariusStarke's avatar
MariusStarke
Regular Visitor
2 years ago
Solved

Filter persistent Distinctcount coloumn on a related table

Hello,

I'm pretty new but not completely unexperienced. Yet this problem drives me crazy. Given are two tables. One with some ProductionOrderPlan and one with the booked capacities on them from different employees. Since we dont tracks how many pieces each employee build each day I need to filter each Capacity Entry out where more than one employee was involved. In the given picture the Capacity Ledgers for Plan1 are good while the ones for Plan2 are bad. I tried to add a filter persistent disctinctcount on the Productionorderplan to filter the desired data. unfortunately i can't get it to work. 

 

This Forum helped me a lot of times allready, but i could not find a solution to my question even though it feels quite common to me.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MariusStarke ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create a calculated column.

    NoOfEmployees =
    CALCULATE (
        DISTINCTCOUNT ( 'CapacityLedgers'[Emyployeev] ),
        FILTER (
            'CapacityLedgers',
            [ProdorderPlan] = EARLIER ( 'ProductionOrderPlan'[ProdorderPlan] )
        )
    )
    

    (3) Then the result is as follows.

     

    Best Regards,

    Neeko Tang

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

4 Replies