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
karimk
Helper III
Helper III

Cumulative Values By Month

Hey guys,

 

I need to make a line chart with monthly cumulative values for a measure I made. The measure tells me how many projects were finished on time (%).

The measure is below:

 

On time = DIVIDE (
CALCULATE ( COUNT ( baseLIC[On time?] ); baseLIC[On time?] = "Yes" );
CALCULATE ( COUNT ( baseLIC[On time?] ); ALLSELECTED(baseLIC[On time?]) )
)

 

Not sure the usual sumx or calculate suggestion works because it´s not really a sum.

I think the idea is to calculate for each month the cumulative total amount of projects with (Yes) divided by the cumulative total amount of projects (Yes+No).

 

Any suggestions?

 

Thanks! 

1 ACCEPTED SOLUTION

Hi @karimk,

 

You may download my file from here.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hey guys. Thanks. I have a simple dataset in the link below.

 

https://www.dropbox.com/s/as25atr7ls4vq20/Sample%20Data.xlsm?dl=0

 

Cheers.

 

Hi @karimk,

 

You may download my file from here.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

The link isn´t working.

Can you try again?

Hi @karimk,

If the solution is acceptable, please mark the useful/helpful reply as answer, and welcome to share your own solution. More members will get workaround easily and clearly.

Thanks,
Angelia

Hi,

 

The link is working just fine.  Please retry.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-huizhn-msft
Employee
Employee

Hi @karimk,

Based on my understanding, you create a line chart, the month is set on Axis, the y-axis shows how many projects were finished on time (%). If it is, please creat a table including month column, try to create a measure using the following formula and check if it works fine.

cumulative total11 =
VAR current =
    MAX ( 'Month'[Month] )
RETURN
    DIVIDE (
        CALCULATE (
            COUNT ( baseLIC[On time?] ),
            FILTER ( baseLIC, baseLIC[Month] <= mm && baseLIC[On time?] = "Yes" )
        ),
        CALCULATE (
            COUNT ( baseLIC[On time?] ),
            FILTER ( baseLIC, baseLIC[Month] <= mm )
        )
    )


For your measure posted, I don't know why do you use ALLSELECTED? There is a slicer in your report? We assume create a measure named("Onetime") to calculate how many projects were finished on time (%), we should get "Onetime" for Jan, "Onetime" of Jan+Feb on Feb month, "Onetime" of Jan+Feb+Mar on Mar month and so on.

In addition, you'd better share some sample data, you can create dummy data and expected result for better analyzing. So that we can reproduce your scenario.

Thanks,
Angelia

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.