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

custom bins

I know this has been asked before, and the answer seemed to be no.  However that was a while ago...

 

With SLAs it's common that there are various targets to be hit - done on the due day, 2 days later, 5 days later 10 days later and so on.  I'd like to be able to colour a stacked bar chart accoding to whatever the SLA defines these numbers of days as.  Unfortunately they are almost never even.  This is an example I've done choosing the bin size myself, it's test data so a little cruddy but I think you can see what I want to do.  On this data there should be one bin for less than zero, another for zero, another for 1-3, another for 4-10 and the last one for over 10.

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
fhill Established Member
Established Member

Re: custom bins

This article seems to do what you want...  They were concerned about the order, but you can do the same thing to 'bypass' the Legend with your own custom Measures ordered correctly in the Values column...

 

https://community.powerbi.com/t5/Desktop/Rearrange-Pies-in-Pie-Chart/m-p/25218#U25218

 

 

Done Early = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] > 0))

On Time = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] = 0))

1-3 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < 0 && Table2[days_over_target] >= -3))

4-10 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < -3 && Table2[days_over_target] >= -10))

Over 10 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < -10 ))

 

 

Capture.PNG

5 REPLIES 5
fhill Established Member
Established Member

Re: custom bins

Can you copy & paste some sample data please?

cats_five Frequent Visitor
Frequent Visitor

Re: custom bins

Here you go.

 

visit_id,play_area_id,days_over_target
2,2,-1
734,2,-13
3,3,1
4,4,1
7,7,-4
9,9,-4
15,15,-2
763,15,-2
16,16,0
29,31,0
528,31,-5
30,32,1
559,32,-5
33,35,-1
525,35,-5
35,37,0
545,37,-5
36,38,0
550,38,-5
37,39,0
511,39,-5
38,40,0
504,40,-5
39,41,0
505,41,-5
40,42,0
495,42,-5
41,43,0
497,43,-5
43,46,-1
598,46,-1
1058,46,0
1059,46,0
50,53,-4
1078,53,0
51,54,-4
1029,54,4
52,55,-4
1028,55,3
56,59,-5
57,61,-5
1026,61,3
1064,61,0
1096,61,0
1098,61,-1
59,63,-5
750,63,-2
1070,63,-21
60,64,-5
62,66,-4
766,66,-2
63,67,-4
1027,67,4
68,73,-4
70,75,-2
1097,75,0
1099,75,-42
71,76,-2
76,81,-2
77,82,-2
79,84,-2
864,84,-3
80,85,1
1062,85,0
1063,85,0
82,88,2
83,89,2
86,94,2
88,98,1
89,99,1
90,100,1
93,103,0
96,107,-1

fhill Established Member
Established Member

Re: custom bins

This article seems to do what you want...  They were concerned about the order, but you can do the same thing to 'bypass' the Legend with your own custom Measures ordered correctly in the Values column...

 

https://community.powerbi.com/t5/Desktop/Rearrange-Pies-in-Pie-Chart/m-p/25218#U25218

 

 

Done Early = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] > 0))

On Time = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] = 0))

1-3 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < 0 && Table2[days_over_target] >= -3))

4-10 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < -3 && Table2[days_over_target] >= -10))

Over 10 Days Late = CALCULATE(COUNT(Table2[days_over_target]), FILTER(Table2,Table2[days_over_target] < -10 ))

 

 

Capture.PNG

cats_five Frequent Visitor
Frequent Visitor

Re: custom bins

Thanks, I will try this out, but probably next week now.

cats_five Frequent Visitor
Frequent Visitor

Re: custom bins

Yes that works, thanks.

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 136 members 1,620 guests
Please welcome our newest community members: