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
TomLU123
Helper III
Helper III

Calculate the Average Completion Rate by using the last value of each row

Dear Experts,

 

I have a data set like this. This data set is to capture the completion rate of each task on specific days. 

SS Dataset.png

I wish to calculate the Overvall Completion Rate by using the last percentage of each task. 

In the example above, Overvall Completion Rate = (50%+40%+30%)/3

 

Is there any expression to create a quick measure to achieve that?

Many thanks!

 

Best regards,

Tom

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @TomLU123

 

Try this approach

 

First unpivot your date columns from Query Editor...You will get

 

unpivot.png

 

Now you can use this MEASURE

 

[Measure ] =
AVERAGEX (
    VALUES ( Table1[Task] ),
    VAR lastnonblankdate =
        CALCULATE ( MAX ( Table1[Date] ), Table1[Value] <> BLANK () )
    RETURN
        CALCULATE ( SUM ( Table1[Value] ), Table1[Date] = lastnonblankdate )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

Hi @TomLU123

 

Try this approach

 

First unpivot your date columns from Query Editor...You will get

 

unpivot.png

 

Now you can use this MEASURE

 

[Measure ] =
AVERAGEX (
    VALUES ( Table1[Task] ),
    VAR lastnonblankdate =
        CALCULATE ( MAX ( Table1[Date] ), Table1[Value] <> BLANK () )
    RETURN
        CALCULATE ( SUM ( Table1[Value] ), Table1[Date] = lastnonblankdate )
)

Regards
Zubair

Please try my custom visuals

Hi Zubair, it works! Thank you so much for the help!

@Zubair_Muhammad

 

Hi Zubair,

 

Just a further check, I have a data set like this. This data set is to capture the completion rate of each task on specific days. But there are empty values since the user havn't update the progress. 

Task DateValue
Task 11-Jun-1830%
Task 11-Jul-1840%
Task 11-Aug-18 
Task 21-Jun-1840%
Task 21-Jul-18 
Task 21-Aug-18 
Task 31-Jun-18 
Task 31-Jul-18 
Task 31-Aug-18 

 

I wish to calculate the Overvall Completion Rate by using the last percentage of each task (including the empty one).

In the example above, Overvall Completion Rate = (40%+40%)/3

 

Is there any expression to create a quick measure to achieve that?

Many thanks!

 

Best regards,

Tom

@TomLU123

 

See attached file as well

 

unpivot2.png


Regards
Zubair

Please try my custom visuals

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.