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

Chart (lines and bars) with cumulative sum based on two different dates

Hello, 

I'm strugling trying to create a measure based on two type date columns for a chart.

I have a table with those facts:

opportunitystatuscreated on (DD/MM/YYYY)oppotunity closed on (DD/MM/YYYY)
Adeclined01/01/202110/06/2021
Bdeclined15/01/202124/11/2021
Capproved20/01/202106/08/2021
Ddeclined03/02/202119/03/2021
Edeclined03/02/202106/04/2021
Fdeclined20/03/202107/08/2021
Gapproved25/03/202107/07/2021
Hdeclined04/04/202123/10/2021
Ideclined11/04/202115/07/2021
Jdeclined11/04/202112/06/2021
Kdeclined30/04/202130/09/2021
Japproved01/05/202104/10/2021
Mapproved07/05/202127/08/2021
Ndeclined09/05/202110/11/2021
Odeclined17/06/202122/11/2021
Pdeclined21/06/202115/11/2021
Qapproved29/06/202115/11/2021
Rin negociation15/08/2021null
Sin negociation20/08/2021null
Tin negociation23/08/2021null

 

this is related with a Calendar Table based on 'oppotunity closed on'. To make the math easier, this Calendar have a CurrentMonthOffset Column, like a countdown to actual month. Like this:

 

Date

Current Month Offset

29/09/2021

-2

30/09/2021

-2

...

...

28/10/2021

-1

29/10/2021

-1

30/10/2021

-1

31/10/2021

-1

01/11/2021

0

02/11/2021

0

03/11/2021

0

04/11/2021

0

 

I want to create a chart like this:

massotebernoull_0-1637772503456.png

 

the cumulative sum of opportunities must be based on column "created on", and the cumulative approved must be based on "opportunity closed on". I'm creating this chart based on Calendar month. The sum of opportunities approved is OK, but I'm not getting a way to create the cumulative sum of all opportunities.

The measure I used to create the opportunities approved is:

 

 

 

 

 

 

CumSum (approved) = 
CALCULATE(COUNT('Table'[opportunity]),
    FILTER(All('Table'), 'Table'[oppotunity closed on (DD/MM/YYYY)] <= MAX('Table'[oppotunity closed on (DD/MM/YYYY)])))

 

 

 

 

 

 

I need help to create the cumulative sum of all opportunities. Can anyone help with this?

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of your PBI file and show the expected result in a Table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-eqin-msft
Community Support
Community Support

Hi @massotebernoull ,

 

Not very clear. 

Did you mean that your CumSum(approved) measure did not return the expected result?

Eyelyn9_0-1638151367871.png

 

Can you please share more detail information to help us clarify your scenario?

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.