cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rfernandez Frequent Visitor
Frequent Visitor

Cumulative graph

Hi,
I have this data 

TypePoRAmountMonth
AReal51
AReal42
AReal53
AReal84
AReal95
APlan21
APlan32
APlan63
APlan34
APlan75
BReal61
BReal72
BReal73
BReal74
BReal105
BPlan51
BPlan52
BPlan73
BPlan84
BPlan85

 

and im trying to create the following graph, that is a cumulative graph for type A and B (real-plan) for each month 

grpah.png

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Cumulative graph

Hi @rfernandez,

 

You can achieve this by creating the following measures:

 

Real-Plan = 
CALCULATE ( SUM ( Plan[Amount] ); Plan[PoR] = "Real" )
    - CALCULATE ( SUM ( Plan[Amount] ); Plan[PoR] = "Plan" )




Cumulative =
CALCULATE (
    SUMX ( Plan; [Real-Plan] );
    FILTER ( ALLSELECTED ( Plan[Month] ); Plan[Month] <= MAX ( Plan[Month] ) )
)

Then just use your cumulative measure on your charts.

 

cumulative.png

Although the ansewer by @AnkitBI is good, a good practice is to create a measure instead of calculated columns since they add size to your model and complexity.

 

This option works both for PBI and for Excel PowerPivot see attach both files with the solutions.

 

Regards,

MFelix

 

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




3 REPLIES 3
AnkitBI Regular Visitor
Regular Visitor

Re: Cumulative graph

Please find the PBIX PBIX. Hope this Helps. I am using Power Query to  get first 3 Output columns and a Calculated Column to get comulative value.

Super User
Super User

Re: Cumulative graph

Hi @rfernandez,

 

You can achieve this by creating the following measures:

 

Real-Plan = 
CALCULATE ( SUM ( Plan[Amount] ); Plan[PoR] = "Real" )
    - CALCULATE ( SUM ( Plan[Amount] ); Plan[PoR] = "Plan" )




Cumulative =
CALCULATE (
    SUMX ( Plan; [Real-Plan] );
    FILTER ( ALLSELECTED ( Plan[Month] ); Plan[Month] <= MAX ( Plan[Month] ) )
)

Then just use your cumulative measure on your charts.

 

cumulative.png

Although the ansewer by @AnkitBI is good, a good practice is to create a measure instead of calculated columns since they add size to your model and complexity.

 

This option works both for PBI and for Excel PowerPivot see attach both files with the solutions.

 

Regards,

MFelix

 

 



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




Super User
Super User

Re: Cumulative graph

Hi,

 

You may download my PBI file from here.

 

Hope this helps.