Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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

  • 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's avatar
    nandukrishnavs
    Icon for Community Champion rankCommunity 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
    🙂

     

    • Anonymous's avatar
      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

      • nandukrishnavs's avatar
        nandukrishnavs
        Icon for Community Champion rankCommunity 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's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

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