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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rfernandez
Regular 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
MFelix
Super User
Super User

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

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my PBI file from here.

 

Hope this helps.


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

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

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



AnkitBI
Solution Sage
Solution Sage

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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