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
ProverbialPaul
Regular Visitor

Associating a cost to a quantity of items

Hello all

 

I have a table that tracks the amount of parts that have been replaced on an item entered into a Sharepoint list through a Powerapp.

 

The table in PowerBI looks as follows:

 

ProverbialPaul_0-1653730549387.png

 

I need to work out how to associate a cost to the parts that have been replaced but I don't know how to do it.

 

I know the cost of each part replaced but that information isn't currently recorded in the above table.

 

I can make a separate table with associated cost, like this:

 

ProverbialPaul_1-1653730833127.png

 

But I don't know how to associate one with the other as there's no associated relationship.

 

Hoping someone can help.

 

Thank you

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @ProverbialPaul,

I would recomend to pivot this table using power query to make the table look like this:
Date|Start_time|finish_time|Module_number|RepairType


Then you will have to tables which are easibly related. 

 

https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882...

 

Or create a measure for each column, 

e.g

measure_drawers_replaced =
SUM ( [drawers replaced] ) * LOOKUPVALUE ( [Cost], [Part], "Drawers replaced" )

 
Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

How to Get Your Question Answered Quickly

View solution in original post

3 REPLIES 3
ProverbialPaul
Regular Visitor

Thanks Gents.

 

Now I think about it, that SP list hasn't been built correctly has it.

 

Each entry should have it's own line with the repair type, duration and qty being associated to a line. That way a cost can be associated and calculated more easily.

 

Thanks for your help, I really appreciate it.

sturlaws
Resident Rockstar
Resident Rockstar

Hi, @ProverbialPaul,

I would recomend to pivot this table using power query to make the table look like this:
Date|Start_time|finish_time|Module_number|RepairType


Then you will have to tables which are easibly related. 

 

https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882...

 

Or create a measure for each column, 

e.g

measure_drawers_replaced =
SUM ( [drawers replaced] ) * LOOKUPVALUE ( [Cost], [Part], "Drawers replaced" )

 
Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

How to Get Your Question Answered Quickly

hnguy71
Memorable Member
Memorable Member

Hi @ProverbialPaul ,

 

You would need to transform your columns to rows and then create a many-to-one relationship:

 

hnguy71_0-1653745230516.png

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.