cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

I need to calculate the percentage of tasks completed on time by each user

Hi,

 

I'm new to Power BI and I need some help, please.

 

I have a table of tasks and each one has two parts, part 1 is done by User X and part 2 is done by User Z. That said, I need to calculate the percentage of tasks completed on time by each user.

 

Task NameCompletedOnTimeByUserXCompletedOnTimeByUserZ
Task 111
Task 201
Task 311
Task 400
Task 511
% of completion on timeN%N%

 

1 indicates on time and 0 late

 

Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: I need to calculate the percentage of tasks completed on time by each user

Hi @efebo 

You could create measures

Capture5.JPG

Measure X =
VAR p1 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[Task Name] ),
        FILTER (
            ALL ( 'Table 2' ),
            'Table 2'[CompletedOnTimeByUserX] = 1
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table 2'[Task Name] ),
            ALL ( 'Table 2' )
        )
RETURN
    IF (
        ISINSCOPE ( 'Table 2'[Task Name] ),
        FORMAT (
            SUM ( 'Table 2'[CompletedOnTimeByUserX] ),
            "General Number"
        ),
        FORMAT (
            p1,
            "Percent"
        )
    )

Measure Y =
VAR p2 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[Task Name] ),
        FILTER (
            ALL ( 'Table 2' ),
            'Table 2'[CompletedOnTimeByUserZ] = 1
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table 2'[Task Name] ),
            ALL ( 'Table 2' )
        )
RETURN
    IF (
        ISINSCOPE ( 'Table 2'[Task Name] ),
        FORMAT (
            SUM ( 'Table 2'[CompletedOnTimeByUserZ] ),
            "General Number"
        ),
        FORMAT (
            p2,
            "Percent"
        )
    )

Best Regards
Maggie
Community Support Team _ Maggie Li
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
Highlighted
Memorable Member
Memorable Member

Re: I need to calculate the percentage of tasks completed on time by each user

@efebo 

 

Is this what you want?

 

Completeontime% = sum('Table'[comeleted on time])/COUNT('Table'[comeleted on time])

1.PNG2.PNG 

Did I answer your question? Mark my post as a solution.Appreciate your Kudos!
Proud a to be a Datanaut!
Thanks and BR
Ryan
Highlighted
Community Support
Community Support

Re: I need to calculate the percentage of tasks completed on time by each user

Hi @efebo 

You could create measures

Capture5.JPG

Measure X =
VAR p1 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[Task Name] ),
        FILTER (
            ALL ( 'Table 2' ),
            'Table 2'[CompletedOnTimeByUserX] = 1
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table 2'[Task Name] ),
            ALL ( 'Table 2' )
        )
RETURN
    IF (
        ISINSCOPE ( 'Table 2'[Task Name] ),
        FORMAT (
            SUM ( 'Table 2'[CompletedOnTimeByUserX] ),
            "General Number"
        ),
        FORMAT (
            p1,
            "Percent"
        )
    )

Measure Y =
VAR p2 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table 2'[Task Name] ),
        FILTER (
            ALL ( 'Table 2' ),
            'Table 2'[CompletedOnTimeByUserZ] = 1
        )
    )
        / CALCULATE (
            DISTINCTCOUNT ( 'Table 2'[Task Name] ),
            ALL ( 'Table 2' )
        )
RETURN
    IF (
        ISINSCOPE ( 'Table 2'[Task Name] ),
        FORMAT (
            SUM ( 'Table 2'[CompletedOnTimeByUserZ] ),
            "General Number"
        ),
        FORMAT (
            p2,
            "Percent"
        )
    )

Best Regards
Maggie
Community Support Team _ Maggie Li
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

Highlighted
Frequent Visitor

Re: I need to calculate the percentage of tasks completed on time by each user

Thank you very much for both @v-juanli-msft and @ryan_mayu 

Highlighted
Frequent Visitor

Re: I need to calculate the percentage of tasks completed on time by each user

Hi @v-juanli-msft,

 

Let's say now I need to calculate the percentage of tasks completed by the department. What do I need to change?

The user wants to know the % completed by department AND user?

 

Do I need to create another measure?

 

Can I combine both?

 

Thanks in advance.

 

 

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors