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
Mkhubaib
Frequent Visitor

Assign sale amounts into different prices ranges

Hi,

I have a table with sales value. i created another table with price ranges as shown below with price ranges

 

Untitled.png

So i wanted to create a visulization with price ranges in one column and sales in other column in a way that sales is distributed according to price ranges. I want end result to be  somthing like shown below:

 

q.png

 

 

1 ACCEPTED SOLUTION

Hi @Mkhubaib ,

 

You can directly add the Price range column to the Sales table.

We create a sample and use SWITCH function to meet your requirement.

 

Price range = 
SWITCH(
    TRUE(),
    Sales[price]>=0&&Sales[price]<200,"1-200",
    Sales[price]>=200&&Sales[price]<400,"200-400",
    Sales[price]>=400&&Sales[price]<600,"400-600",
    "Others"
    )

 

as1.jpg

 

Then we can create a column chart using price range and sales amount.

 

as2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on some fake data?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

4 REPLIES 4

@amitchandak Oh, its not matching beacuse its just a sample of what i want.

Hi @Mkhubaib ,

 

You can directly add the Price range column to the Sales table.

We create a sample and use SWITCH function to meet your requirement.

 

Price range = 
SWITCH(
    TRUE(),
    Sales[price]>=0&&Sales[price]<200,"1-200",
    Sales[price]>=200&&Sales[price]<400,"200-400",
    Sales[price]>=400&&Sales[price]<600,"400-600",
    "Others"
    )

 

as1.jpg

 

Then we can create a column chart using price range and sales amount.

 

as2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on some fake data?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

az38
Community Champion
Community Champion

Hi @Mkhubaib 

Highly reccomend to use this technique https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.