Forum Discussion

Mourt's avatar
Mourt
Icon for Helper I rankHelper I
3 years ago
Solved

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%






  • Hi Mourt 

     

    Please find below an appraoch:

     

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

     

     

    2) Data model

     

    3) Measure and result

     

     

    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.

     

     

     

     

     

     

     

3 Replies

  • Mikelytics's avatar
    Mikelytics
    Icon for Resident Rockstar rankResident Rockstar

    Hi Mourt 

     

    Please find below an appraoch:

     

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

     

     

    2) Data model

     

    3) Measure and result

     

     

    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.

     

     

     

     

     

     

     

    • Mourt's avatar
      Mourt
      Icon for Helper I rankHelper I

      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())