cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Cumulative chart does not cummulate

Hi Power BI Community!

I want to show a cumulative chart after what delivery time span all deliveries had reached the customers.

Did not cumulate.PNG

At first the chart looks fine but the line must always go up because it should add the numbers. So the fram of 10-15 must be bigger than 5-10 and so on.

Here is my calculation:

On Axis:
Delivery time frame =
var _diff = datediff([PO Date] , [delivered on],DAY)
return
Switch ( True() ,
_diff <= 2, " 0-2" ,
_diff <= 5, " 2-5" ,
_diff <= 10, "5-10" ,
_diff <= 15, "10-15" ,
_diff <= 30, "15-30" ,
"more than 30"
)


On values:

Cumulative PO to delivery =
CALCULATE([Total PO],
FILTER(ALLSELECTED(TrackET),
TrackET[Delivery time frame]<= MAX(TrackET[Delivery time frame])))


Total PO is just 

Total PO = SUM(TrackET[PO to delivered on])+0
PO to delivered on = Delivered on date - PO Date
 
Thank you for your time!
1 ACCEPTED SOLUTION
Super User IV
Super User IV

@Beginner_2020 , I think this because of sorting issue. I am assuming you have also created a sort column as I can see 10-15 at the correct position

 

do this on sort column

Cumulative PO to delivery =
CALCULATE([Total PO],
FILTER(ALLSELECTED(TrackET),
TrackET[Delivery time frame sort]<= MAX(TrackET[Delivery time frame sort])))

 

where sort would be like

Delivery time frame sort =
var _diff = datediff([PO Date] , [delivered on],DAY)
return
Switch ( True() ,
_diff <= 2, 1 ,
_diff <= 5, 2 ,
_diff <= 10, 3 ,
_diff <= 15, 4 ,
_diff <= 30, 5,
6
)

 

what is sort column - https://www.youtube.com/watch?v=KK1zu4MBb-c



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

@Beginner_2020 , I think this because of sorting issue. I am assuming you have also created a sort column as I can see 10-15 at the correct position

 

do this on sort column

Cumulative PO to delivery =
CALCULATE([Total PO],
FILTER(ALLSELECTED(TrackET),
TrackET[Delivery time frame sort]<= MAX(TrackET[Delivery time frame sort])))

 

where sort would be like

Delivery time frame sort =
var _diff = datediff([PO Date] , [delivered on],DAY)
return
Switch ( True() ,
_diff <= 2, 1 ,
_diff <= 5, 2 ,
_diff <= 10, 3 ,
_diff <= 15, 4 ,
_diff <= 30, 5,
6
)

 

what is sort column - https://www.youtube.com/watch?v=KK1zu4MBb-c



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors