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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sindhusabbineni
Regular Visitor

calculate the distinct number of users who have a certain value in all the fields

I am a beginner in power BI. So, excuse me if this is a basic question.

I have data like this:

User1 - Task A - Complete
User1 - Task B - InComplete
User1 - Task C - Complete
User 2 - Task A - Complete
User 2 - Task B - Complete
User 2 - Task C - Complete

Now, I want to get the number of distinct users in the list who have completed all the tasks in power BI. So, for the above example, there is only one user(User2) who have completed all three tasks. I have 7 such tasks and thousands of users, how do i get the number of distinct users that completed all the tasks, something like a DAX formula.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @sindhusabbineni 

We just need a couple measure.  The first one to count the number of copleted lines.  If your User / Task combination is unique, meaning the same User / Task will not appear in your table more than once, you can do it with just this.

Completed Count = 
CALCULATE(
COUNTROWS ( Table ),
Table[Complete/incomplete] = "Complete"
)

If they can be duplicated then you will need something like this

Completed Count = 
CALCULATE(
COUNTROWS(
    SUMMARIZE('Table','Table'[User],'Table'[Task])
),Table[Complete/incomplete] = "Complete")

Then we do a measure to count the users where our [Completed Count] = 7

Users 7 completed count = 
COUNTROWS(
    FILTER(
        DISTINCT('Table'[User]),
        [Completed Count] = 7 )
)

 

 

View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @sindhusabbineni 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
smpa01
Super User
Super User

@sindhusabbineni  the following measure gives you count of "complete" task by user

 

Complete_Count Measure=
COUNTROWS (
    SUMMARIZE (
        FILTER ( TaskTable, TaskTable[Complete/incomplete] = "Complete" ),
        TaskTable[User],
        TaskTable[Task]
    )
)

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
jdbuchanan71
Super User
Super User

Hello @sindhusabbineni 

We just need a couple measure.  The first one to count the number of copleted lines.  If your User / Task combination is unique, meaning the same User / Task will not appear in your table more than once, you can do it with just this.

Completed Count = 
CALCULATE(
COUNTROWS ( Table ),
Table[Complete/incomplete] = "Complete"
)

If they can be duplicated then you will need something like this

Completed Count = 
CALCULATE(
COUNTROWS(
    SUMMARIZE('Table','Table'[User],'Table'[Task])
),Table[Complete/incomplete] = "Complete")

Then we do a measure to count the users where our [Completed Count] = 7

Users 7 completed count = 
COUNTROWS(
    FILTER(
        DISTINCT('Table'[User]),
        [Completed Count] = 7 )
)

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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