Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors