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
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
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.