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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How would you approach this? Creating a reference for range of percentages

I have data which list out the cost / price / margin % of individual items. There is another reference table that list cost range for items to fall in and the targeted gross margin.

 

SOLUTION NEEDED:

1) To categorize cost of each item by bucketing to a certain cost range

2) Does it meet or exceed the target gross margin by creating an output of either "YES" or "NO".

 

How would you approach this scenario? I thought about creating IF statements but there are hundreds of items and I am unsure on how to build this out as either a DAX measure or calculated column.

 

Please see screenshots below.

 

Your expertise is greatly appreciated!

 

Table 1 = Sample data with cost / price / margin %

 

itemcostpricemargin%.png

 

 

Table 2 = Cost Range / Gross Margin % Target / Falls Within Target Margin?

 

CostGross MarginFall Within Target Margin?
$0.00 - $0.3983.30%Yes/No
$0.40 - $0.4983.30%Yes/No
$0.50 - $0.9981.80%Yes/No
$1.00 - $1.4980.00%Yes/No
$1.50 - $3.9977.78%Yes/No
$4.00 - $7.9975.00%Yes/No
$8.00 - $19.9971.00%Yes/No
$20.00 - $39.9966.67%Yes/No
$40.00 - $49.9963.64%Yes/No
$50.00 - $199.9960.00%Yes/No
$200.00 - $1,699.0055.00%Yes/No
$1,700.00 - $2,499.0053.00%Yes/No
$2,500.00 +50.00%Yes/No
1 ACCEPTED SOLUTION
mattbrice
Solution Sage
Solution Sage

You want to assign each Item in Table 1 to a band based on price which is specified in Table 2.   After assigned to a band, compare it to targe Gross Margin % target to determin if it meets goal.  There are a lot of articles out there explaining how to implement banding.  Here is one:

https://exceleratorbi.com.au/banding-in-dax/

View solution in original post

2 REPLIES 2
mattbrice
Solution Sage
Solution Sage

You want to assign each Item in Table 1 to a band based on price which is specified in Table 2.   After assigned to a band, compare it to targe Gross Margin % target to determin if it meets goal.  There are a lot of articles out there explaining how to implement banding.  Here is one:

https://exceleratorbi.com.au/banding-in-dax/

Anonymous
Not applicable

@mattbrice Thank you so much for your response! I was successful in creating the banding!

 

I am having a problem with creating the categorization of either "Yes" or "No". Essentially, I am comparing a measure from one table against the Target Gross Margin % of another table (which is a disconnected table). The hope is to generate an output of either "Yes" or "No" from the comparison.

Below is my DAX measure but I am getting an error "A table of multiple values was supplied where a single value was expected". Not sure on how else to go about this because I have tried to rework the syntax a few ways but am still getting the same result.

 

Any guidance will be greatly appreciated!

 

Target Gross Margin % =
IF(
    [Margin %_purch] >=
    FILTERS('Cost Gross Margin%'[Gross Margin]),
    "Yes", "No"
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.