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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jcastr02
Post Prodigy
Post Prodigy

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%

2 ACCEPTED SOLUTIONS
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. 

vtangjiemsft_0-1704248858975.png

(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.

vtangjiemsft_1-1704248960312.png

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. 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

The grouping ranges will have to be created manually.  You may refer to my solution to a similar problem in the attached PBI file.


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

The grouping ranges will have to be created manually.  You may refer to my solution to a similar problem in the attached PBI file.


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

Hi,

The grouping ranges will have to be created manually.  You may refer to my solution to a similar problem in the attached PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
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. 

vtangjiemsft_0-1704248858975.png

(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.

vtangjiemsft_1-1704248960312.png

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. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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