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
cdawidow
Helper III
Helper III

Calculating Gross Margin Levels filtered by product line and sales amount?

Hi guys, I am having trouble calculating gross margin levels based on sale volumes across my various product catagories.  Would if be easier to create a calculated Column or a measure to do this?

 

I have created a measure such as this but it is coming up blank at times even though I know the sales amount fall within these catagories.

 
GM% Levels = CALCULATE([Gross Margin %],FILTER(ALLSELECTED(ORDHDT01[PRD PC]),[Total Sales]<=10000))
 
Table Date =
 
Net Sales   PRD PC     
$5,000          GMX
$200              HOF
 
ETC...

 

1 REPLY 1
lbendlin
Super User
Super User

A measure is the right approach as the result can be impacted by user filter choices. 

 

But your measure uses other measures, and it is impossible to judge without seeing the code for these.

 

Your FILTER() is a bit excessive, can probably be rewritten as

 

GM% Levels = CALCULATE([Gross Margin %],ALLSELECTED(ORDHDT01[PRD PC]),[Total Sales]<=10000)

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.