cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mourt
Helper I
Helper I

Cumulative Completion Rate with Month Slicer

Hi everyone,

I'm trying to calculate cumulative completion rate by all users over moths, the issue is that in the below table for ex when I filter on october it divides users who finished till october / all users except those who finished in November.

I have a dim_date table which is connect to the data table, the retaltion is between Date from dim_date and Completion Date from Data table
Also in dim date table im numbering the months 1,2,3,4 etc

IDCompletion_statusCompletion Date
10 
20 
30 
40 
50 
6111/1/2022
7111/1/2022
8111/1/2022
9111/2/2022
10111/1/2022
11111/6/2022
12111/4/2022
13111/2/2022
14110/13/2022
15110/14/2022
16110/14/2022
17110/13/2022
18110/15/2022
19110/13/2022
20110/13/2022
21110/13/2022
22110/13/2022
23110/18/2022
24110/13/2022
25110/13/2022
26110/13/2022
27110/13/2022
2819/10/2022
2919/8/2022


the formula I use
Completion% = 
VAR comp rate = SUM(Table[completion_status]) / count(Table[ID])
Return

CALCULATE(Table[Completion%],filter(ALL(Dim_Date),Dim_Date[Month Number] <= MAX(Dim_Date[Month Number])))

the expected result when I filter
on september is 2/29 = 7%
on october is 16/29 = 55%
on November is 24/29 = 83%






1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Mourt 

 

Please find below an appraoch:

 

1) base table (completion status is type "whole number")

 

Mikelytics_3-1667938232338.png

 

2) Data model

Mikelytics_1-1667937870545.png

 

3) Measure and result

Mikelytics_5-1667938568842.png

 

 

Completion% = 

var var_RollingCompletion =
    CALCULATE(
        SUM(CompletionRate[Completion_status]),
        ALL(DimDate),
        DimDate[Date]<= MAX(DimDate[Date])
    ) 

var var_AllItems = 
    CALCULATE(
        COUNTROWS(CompletionRate),
        ALL(CompletionRate)
    )

RETURN
DIVIDE(var_RollingCompletion, var_AllItems, BLANK())

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

3 REPLIES 3
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Mourt 

 

Please find below an appraoch:

 

1) base table (completion status is type "whole number")

 

Mikelytics_3-1667938232338.png

 

2) Data model

Mikelytics_1-1667937870545.png

 

3) Measure and result

Mikelytics_5-1667938568842.png

 

 

Completion% = 

var var_RollingCompletion =
    CALCULATE(
        SUM(CompletionRate[Completion_status]),
        ALL(DimDate),
        DimDate[Date]<= MAX(DimDate[Date])
    ) 

var var_AllItems = 
    CALCULATE(
        COUNTROWS(CompletionRate),
        ALL(CompletionRate)
    )

RETURN
DIVIDE(var_RollingCompletion, var_AllItems, BLANK())

 

Best regards

Michael

-----------------------------------------------------

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

@ me in replies or I'll lose your thread.

 

 

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Thanks for the solution, works perfectly, just did a slight modification as Users belong to different departments

Completion% = 

var var_RollingCompletion =
    CALCULATE(
        SUM(CompletionRate[Completion_status]),
        ALL(DimDate),
        DimDate[Date]<= MAX(DimDate[Date])
    ) 

var var_AllItems = 
    CALCULATE(
        COUNTROWS(CompletionRate),
        ALL(CompletionRate)
    )

RETURN
DIVIDE(var_RollingCompletion, var_AllItems, BLANK())

@Mourt  Aweseom! Thank you for the feedback! 🙂

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.