Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I need to create a measure for a model sampled as below
Equipment | Fixed Cost.Fix Cost | Origin Name |
16P | ₹ 9,00,000 | Ameenpur |
12P | ₹ 25,000 | Atmakuru |
10P | ₹ 4,50,000 | Atmakuru |
14P | ₹ 8,50,000 | Atmakuru |
16P | ₹ 9,00,000 | Atmakuru |
16P | ₹ 9,00,000 | Bangalore-Bidadi-DPG |
16P | ₹ 9,00,000 | Bharatiyam Copack |
16P | ₹ 9,00,000 | Bidadi Plant |
16P | ₹ 9,00,000 | Bidadi Plant 2 |
14P | ₹ 8,50,000 | Bowrampet Depot - GT |
14P | ₹ 8,50,000 | Bowrampet Depot - NKA |
16P | ₹ 9,00,000 | Coimbatore Depot |
18N | ₹ 3,00,000 | Dasna |
10P | ₹ 4,50,000 | Dasna |
14P | ₹ 8,50,000 | Dasna |
16P | ₹ 9,00,000 | Dasna |
16P | ₹ 9,00,000 | Gangaikondan Copack |
10P | ₹ 4,50,000 | Goa |
18N | ₹ 3,00,000 | Gourpuri Depot |
14P | ₹ 8,50,000 | Gourpuri Depot |
10P | ₹ 4,50,000 | Jhilmil Depot |
18N | ₹ 3,00,000 | Kanpur Depot |
18N | ₹ 3,00,000 | Khorda |
10P | ₹ 4,50,000 | Maula Ali Depot |
16P | ₹ 9,00,000 | Nemam |
16P | ₹ 9,00,000 | Redhills Depot |
10P | ₹ 4,50,000 | Srikalahasti |
16P | ₹ 9,00,000 | Srikalahasti |
12P | ₹ 25,000 | Vizag Depot |
10P | ₹ 4,50,000 | Vizag Depot |
14P | ₹ 8,50,000 | Vizag 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
Solved! Go to 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 🙂
@Anonymous So put EquipmentFixed in a Table visualization and use the default Average aggregation for Cost.Fix?
@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
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
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 🙂
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 🙂
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |