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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Nelson-Cheng
New Member

Calculate average value from multiple measures, and then exclude the outliner

I have a list of items cost from different manufacturer & in different currency.

So i create a measure to convert each manufacturing cost with dynamic currency conversion. But i need to compare the manufacturer cost item by item to get each item's average cost.

And then base on the average manufacturer cost to set a threshold if any manufacturer cost is above or below 50% compare to the average manufacturer cost to be excluded. Then recalculate the NEW average manufacturer cost.

With the NEW average manufacturer cost, i compare it with the lowest manufacturer cost and try to get the cost saving item by item.

 

I create the below formula, it is able to calculate and display in a Table one by one.

But it turns out the total in the table format or in the summarize card format visual, it is not correct as the calculation will calculate againe in the total level......

 

Can anyone help for this case?

 

What i have already: 

Manufacturer A cost = [CostA]

Manufacturer B cost = [CostB]

Manufacturer C cost = [CostC]

 

What i try to do for the measure to get the New average to excl 50% above / below : 

//to exclude if the manufacturer didn't provide with cost

VAR _costcount = INT ( [Cost A] <> BLANK () )+ INT ( [Cost B] <> BLANK () )+ INT ( [Cost C] <> BLANK () )

VAR _threshold = DIVIDE ( [Cost A] + [Cost B] + [Cost C] , _costcount)

VAR _upperthreshold = _threshold*1.5
VAR _lowwerthreshold = _threshold*0.5
VAR _CostA = IF( [Cost A] <> BLANK(), IF(AND([Cost A]>=_lowwerthreshold , [Cost A]<=_upperthreshold), [Cost A]))

VAR _CostB = IF( [Cost B] <> BLANK(), IF(AND([Cost B]>=_lowwerthreshold , [Cost B]<=_upperthreshold), [Cost B]))

VAR _CostC = IF( [Cost C] <> BLANK(), IF(AND([Cost C]>=_lowwerthreshold , [Cost C]<=_upperthreshold), [Cost C]))

VAR _newcostcount = INT ( _CostA<> BLANK () )+ INT ( _CostB <> BLANK () )+ INT ( _CostC <> BLANK () )

RETURN
DIVIDE (_CostA +_CostB +_CostC, _newcostcount )
 
 
Check the saving between Lowest Cost with New Average Cost
Cost Save = [Average excl 50% above & below] - 'Factory Cost'[CostA]
 

Test.jpg

 

 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nelson-Cheng ,
try like
Cost Save new = sumx(Values(Table[Item]),[Cost Save])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Nelson-Cheng ,
try like
Cost Save new = sumx(Values(Table[Item]),[Cost Save])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Great Thanks

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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