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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.