Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago
Solved

Calculate Cost

Hello

I'm new to the community, I'm trying to calculate the total cost of implementing a solution in power apps and power bi. For this create a list of items that I need and their price, the idea is that if I select 1 items that for example is worth 100 and I create a parameter that goes from 1 to 35 to choose 5 make me the result 5 * 100 = 500, the problem is that each item has a different calculation and putting it in a table does not add the value.

Cálculo2 =
SWITCH ( VALUE SELECTED ( Prices [IDitem] ),
1 , [Value Machines] * SUM ( Prices [Price] ),
2 , [Dollar Value] * [Value Machines] * SUM ( Prices [Price] ),
3 , [Dollar Value] * SUM ( Prices [Price] ),
SUM ( Prices [Price] )
)
Is it possible to do what I need? if someone could help me I would appreciate them very much.
Best regards
  • If you have items with a cost similar to

    You can write a measure like

    as an example using four parameters, having different calculations for each item and getting the sum.

    The result could look something like

     

    Hope this gets you started in the right direction.

     

3 Replies

  • If you have items with a cost similar to

    You can write a measure like

    as an example using four parameters, having different calculations for each item and getting the sum.

    The result could look something like

     

    Hope this gets you started in the right direction.

     

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    are you able to share your data, your file?

     

    how is the column aggregating?   if you look where you placed the field adn drop down the arrow to the right of the field it should tell you.

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Carlos_C_V 

     

    Based on your current measure Cálculo2, you can add a new measure like below and add it to the table visual. 

    Total Cost = SUMX ( VALUES ( Prices[IDitem] ), [Cálculo2] )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.