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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

MCF Mean cumulative function in Power BI

I have been trying to get this to work for weeks and finally found the courage to ask my fellow Power BI hustlers for help.

 

The theory is simple: The MCF cumulates the number of events (e.g. repairs) over time. This leads to a "step function" like in this example: 

lukas_r_1-1695799498584.png

The size/height of a step is calculated: step size (t) = 1/number of active machines at time t

 

Now let's take this sample data

Maschine number

Repair ID

Time of failure (in days after maschine was marked as active)

1

1

35

1

2

51

1

3

69

1

4

70

1

5

78

2

6

34

2

7

55

2

8

55

2

9

74

2

10

96

2

11

339

2

12

453

 

Simply cumulating the events over time is easy:

 

 

 

Events cumulated =
CALCULATE (
    DISTINCTCOUNT ( data[repair_id] ),
    FILTER (
        ALL ( data[Time of failure] ),
        data[Time of failure] <= MAX ( data[Time of failure] )
    )
)

 

 

 

lukas_r_2-1695799518476.png

 

The number of active maschines:

 

 

 

No maschines =
CALCULATE (
    DISTINCTCOUNT ( data[Maschine number] ),
    data[Time of failure] >= MAX ( data[Time of failure] )
)

 

 

 

lukas_r_0-1695799472448.png

 

The problem is bringing the the measures together to get the right step sizes for the function. I have tried many variations of the following:

 

 

 

MCF =
CALCULATE (
    DISTINCTCOUNT ( data[repair_id] ),
    FILTER (
        ALL ( data[Time of failure] ),
        data[Time of failure] <= MAX ( data[Time of failure] )
    )
) / [No maschines]

 

 

 

 

lukas_r_3-1695799593649.png

While both maschines are active the step size is correct as 1 / 2 = 0,5. But after the functions goes crazy.

 

Please, does anyone know what I am doing wrong? Thank you so much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

For anyone interersted, I believe to have found a solution to my problem.

 

No maschines =
CALCULATE (
    DISTINCTCOUNT ( data[Maschine number] ),
    data[Time of failure] >= MAX ( data[Time of failure] )
)

 

Step_Size = DISTINCTCOUNT(data[repair_id]) / [No machines]

 

MCF = 
SUMX(
	FILTER(
		ALLSELECTED(data[Time of failure]),
		data[Time of failure] <= MAX ( data[Time of failure] )
	),
    [Step_Size]
)

View solution in original post

4 REPLIES 4
ZvikaBK2801
New Member

Hi, 

Your solution is nice but cannot proprly handle a realistic situation in which the time to event include system censoring events as well as incomplete recurrent data with right censoring events. I have complete solution to both, as well as other realistic techenical issues. BTW, what about calculating confidence intervals around MCF? Let me know if you are interested.

Anonymous
Not applicable

For anyone interersted, I believe to have found a solution to my problem.

 

No maschines =
CALCULATE (
    DISTINCTCOUNT ( data[Maschine number] ),
    data[Time of failure] >= MAX ( data[Time of failure] )
)

 

Step_Size = DISTINCTCOUNT(data[repair_id]) / [No machines]

 

MCF = 
SUMX(
	FILTER(
		ALLSELECTED(data[Time of failure]),
		data[Time of failure] <= MAX ( data[Time of failure] )
	),
    [Step_Size]
)
lbendlin
Super User
Super User

your data seems to be missing a timestamp column? How would you know both machines are active at the same time?

Anonymous
Not applicable

Hello @lbendlin, thank you for replying.

 

In my opinion, a timestamp is not needed (see also example here: MCF github . For simplicity I would assume that machines are not active anymore, after the last repair event (see my second measure "No machines") . I am adding timestamp columns to the data below, in case it can help. Thank you again for trying to help!

 

Maschine numberMaschine activation dateRepair IDRepair dateTime of failure (in days after maschine was marked as active)
122.08.2022126.09.202235
122.08.2022212.10.202251
122.08.2022330.10.202269
122.08.2022431.10.202270
122.08.2022508.11.202278
218.03.2022621.04.202234
218.03.2022712.05.202255
218.03.2022812.05.202255
218.03.2022931.05.202274
218.03.20221022.06.202296
218.03.20221120.02.2023339
218.03.20221214.06.2023453

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors