Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MariusStarke
Regular Visitor

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. 

MariusStarke_0-1727252443496.png

 

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.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vtangjiemsft_0-1727420585333.png

 

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. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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.

vtangjiemsft_0-1727420585333.png

 

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. 

Thank you for your effort. It worked for me.

MariusStarke
Regular Visitor

@sanalytics 

 

I'm sorry the question didn't met the requirements. 

 

The desired output in this case would be a persistent calculated coloumn in the ProductionOrderPlan Table which says 'NoOfEmployees' which would give 1 for Plan1 and 3 for Plan2. I hope this carifies the question.

sanalytics
Super User
Super User

@MariusStarke 
Please go through below link before posting something here

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Qu... 

 

Going forward, please provide some input and desired output with proper explanation rather than a screenshot.

 

Regards

sanalytics

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.