Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

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.

Carlos_C_V_1-1664551407737.png

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
1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

If you have items with a cost similar to

jgeddes_0-1664552778958.png

You can write a measure like

jgeddes_1-1664552822194.png

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

The result could look something like

 

jgeddes_2-1664552908933.png

Hope this gets you started in the right direction.

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
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.

vanessafvg
Super User
Super User

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.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




jgeddes
Super User
Super User

If you have items with a cost similar to

jgeddes_0-1664552778958.png

You can write a measure like

jgeddes_1-1664552822194.png

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

The result could look something like

 

jgeddes_2-1664552908933.png

Hope this gets you started in the right direction.

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.