Forum Discussion
Help with creating a complex measure
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
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 🙂
6 Replies
- nandukrishnavs
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
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- AnonymousNot 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
- nandukrishnavs
Community Champion
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 🙂
- Greg_Deckler
Community Champion
Anonymous So put EquipmentFixed in a Table visualization and use the default Average aggregation for Cost.Fix?