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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX to display all the bins/ranges for each value in a column

Hi All,

I have a requirement to create bins/ranges for Total Sales as shown in the screenshot below:

SaloniGupta_1-1632253077271.png


I have tried creating DAX Measure for this :

Total Earned Sales Range =
SWITCH(
TRUE(),
[Total Sales] <= 0 ,"0 or blank" ,
[Total Sales] <=500000 , "0-500,000",
[Total Sales] <=1000000 , "500,000-1,000,000",
[Total Sales] <=1500000 , "1,000,000-1,500,000",
[Total Sales] <=2000000 , "1,500,000-2,000,000",
[Total Sales] <=2500000 , "2,000,000-2,500,000",
[Total Sales] <=3000000 , "2,500,000-3,000,000",
[Total Sales] <=3500000 , "3,000,000-3,500,000","3,500,000 and more")

But the result in PowerBI is as shown below:
SaloniGupta_2-1632253194121.png
This is the wrong output since there are many more bins for each vertical (to show that I have selected a few Client Ids).
SaloniGupta_3-1632253557145.png


Can you pls help me resolve this requirement as to how to display all the bins/ranges for each vertical?

Please let me know if you need more information or if the requirement is not clear enough.

Here is the sample data with expected output:
https://docs.google.com/spreadsheets/d/1aDJ3-bPulmtj4teKzgtuZ7CcsQ4HuhZs/edit?usp=sharing&ouid=11317... 
@Ashish_Mathur- Can you please help me with this?

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

In the actual source data, do you have column C already or is that something you created manually?  Please share the exact column that are there in your raw data set.


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

Hi @Ashish_Mathur,
You are right, Column C is not there already in my dataset. Columns H and I are the ones I am trying to create. Updated the sheet.
https://docs.google.com/spreadsheets/d/1aDJ3-bPulmtj4teKzgtuZ7CcsQ4HuhZs/edit?usp=sharing&ouid=11317...

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

Hi @Ashish_Mathur,
Thank you for the amount of time and effort you put into this.
That was very helpful.


You are welcome.


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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