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

Help with creating a complex measure

I need to create a measure for a model sampled as below

EquipmentFixed Cost.Fix CostOrigin Name
16P₹ 9,00,000Ameenpur
12P₹ 25,000Atmakuru
10P₹ 4,50,000Atmakuru
14P₹ 8,50,000Atmakuru
16P₹ 9,00,000Atmakuru
16P₹ 9,00,000Bangalore-Bidadi-DPG
16P₹ 9,00,000Bharatiyam Copack
16P₹ 9,00,000Bidadi Plant
16P₹ 9,00,000Bidadi Plant 2
14P₹ 8,50,000Bowrampet Depot - GT
14P₹ 8,50,000Bowrampet Depot - NKA
16P₹ 9,00,000Coimbatore Depot
18N₹ 3,00,000Dasna
10P₹ 4,50,000Dasna
14P₹ 8,50,000Dasna
16P₹ 9,00,000Dasna
16P₹ 9,00,000Gangaikondan Copack
10P₹ 4,50,000Goa
18N₹ 3,00,000Gourpuri Depot
14P₹ 8,50,000Gourpuri Depot
10P₹ 4,50,000Jhilmil Depot
18N₹ 3,00,000Kanpur Depot
18N₹ 3,00,000Khorda
10P₹ 4,50,000Maula Ali Depot
16P₹ 9,00,000Nemam
16P₹ 9,00,000Redhills Depot
10P₹ 4,50,000Srikalahasti
16P₹ 9,00,000Srikalahasti
12P₹ 25,000Vizag Depot
10P₹ 4,50,000Vizag Depot
14P₹ 8,50,000Vizag Depot

 

Problem statement :

I need a measure to give the average fixed cost for every equipment type, that is division of equipment fixed cost and count of that equipment.

for eg: for equipment 12P, Avg fixed cost = (25000/2)

 

Any comment or suggestions will be helpful

 

TIA

1 ACCEPTED SOLUTION

@Anonymous 

 

Try this 

 

Avg fixed cost = 
var _count= COUNTROWS(FILTER(ALL('Table'),'Table'[Equipment]=SELECTEDVALUE('Table'[Equipment])))
var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost])
var _result= DIVIDE(_fixedcost,_count,BLANK())
return _result

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

@Anonymous So put EquipmentFixed in a Table visualization and use the default Average aggregation for Cost.Fix?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
nandukrishnavs
Community Champion
Community Champion

@Anonymous 

 

As per your example, the logic is the fixed cost of equipment divided by the count of equipment. 

 

Try this 

 

Avg fixed cost = 
var _count= COUNT('Table'[Equipment])
var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost])
var _result= DIVIDE(_fixedcost,_count,BLANK())
return _result

 

Capture.JPG



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

Anonymous
Not applicable

hi @nandukrishnavs & @Greg_Deckler  thanks for replying,

 

The solution @nandukrishnavs  has given worked at the selected or filtered level.

But what I actually want is, the count for coresponding equipment in the entire data set to remain constant.

 

Hence should give me constant fixed cost for individual equipment, irrespective of any filter I apply

@Anonymous 

 

Try this 

 

Avg fixed cost = 
var _count= COUNTROWS(FILTER(ALL('Table'),'Table'[Equipment]=SELECTEDVALUE('Table'[Equipment])))
var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost])
var _result= DIVIDE(_fixedcost,_count,BLANK())
return _result

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

Thanks @nandukrishnavs, it worked just like I wanted.

I now understood how to use FILTER command,

I will much appreciate if you can please post some informative link to understand FILTER command and its applications.

 

Thanks again. 🙂

@Anonymous 

 

Refer to this: https://www.sqlbi.com/articles/filter-arguments-in-calculate/



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

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.