Forum Discussion

jcastr02's avatar
jcastr02
Post Prodigy
2 years ago
Solved

grouping ranges

I have a table with the monthly call volume per store.  I'd like to do a visual like such below but I'm having a hard time even determining what the grouping ranges should be.  Is there a tool that can help me determine the grouping ranges (0-X, X-Y, Y-Z).  **I'm not limited to 3 groupings only, it's just for example purposes.   Thanks

 

Monthly Call Volume                    % of Total

0-X / Month                                     10%

X-Y / Month                                      40%
Y-Z / Month                                      50%

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi jcastr02 ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create calculated columns.

    Rank = RANKX(FILTER('Table','Table'[store]=EARLIER('Table'[store])),'Table'[Call Volume],,ASC,Dense) 
    Monthly Call Volume = 
    var _a=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=1))
    var _b=IF('Table'[Rank]=1,0 & "-" & _a)
    var _c=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=EARLIER('Table'[Rank])))
    var _d=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=EARLIER('Table'[Rank])+1))
    RETURN SWITCH(TRUE(),
    'Table'[Rank]=1,0 & "-" & _a & " /Month", 
    'Table'[Rank] <> 1,_c & "-" & _d & " /Month")

    (3) We can create a measure.

    % of Total = 
    var _a=CALCULATE(SUM('Table'[Call Volume]),FILTER(ALLSELECTED('Table'),'Table'[store]=MAX('Table'[store])))
    var _b=CALCULATE(SUM('Table'[Call Volume]),FILTER(ALLSELECTED('Table'),'Table'[Rank]=MAX('Table'[Rank]) &&'Table'[store]=MAX('Table'[store])))
    RETURN DIVIDE(_b,_a,0)

    (4) Then the result is as follows.

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jcastr02 ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create calculated columns.

    Rank = RANKX(FILTER('Table','Table'[store]=EARLIER('Table'[store])),'Table'[Call Volume],,ASC,Dense) 
    Monthly Call Volume = 
    var _a=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=1))
    var _b=IF('Table'[Rank]=1,0 & "-" & _a)
    var _c=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=EARLIER('Table'[Rank])))
    var _d=CALCULATE(MIN('Table'[Call Volume]),FILTER('Table','Table'[store]=EARLIER('Table'[store]) && 'Table'[Rank]=EARLIER('Table'[Rank])+1))
    RETURN SWITCH(TRUE(),
    'Table'[Rank]=1,0 & "-" & _a & " /Month", 
    'Table'[Rank] <> 1,_c & "-" & _d & " /Month")

    (3) We can create a measure.

    % of Total = 
    var _a=CALCULATE(SUM('Table'[Call Volume]),FILTER(ALLSELECTED('Table'),'Table'[store]=MAX('Table'[store])))
    var _b=CALCULATE(SUM('Table'[Call Volume]),FILTER(ALLSELECTED('Table'),'Table'[Rank]=MAX('Table'[Rank]) &&'Table'[store]=MAX('Table'[store])))
    RETURN DIVIDE(_b,_a,0)

    (4) Then the result is as follows.

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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