cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Adding Kit Component Costs to Compare

I am brand new to Power BI and am trying to match soon to be outdated company reports. One of the services we provide is product kits comprised of several other kits. The only functionality I am unable to mirror is adding the costs of the components to compare with the stored cost of the master kit. I would like the TTL CC of Components to be the sumproduct of ComponentCurrentCost and Quantity for the MasterItemNumber.

 

TTL CC of Components = CALCULATE(SUMX(vwFactKitComponentCurrent,vwFactKitComponentCurrent[Quantity]*RELATED(DimInventoryItemComponent[ComponentCurrentCost])))

 
 

 

 

I have tried using ALL to return all of the component table, but to no avail. It returns the same result. 

TTL CC of Components = CALCULATE(SUMX(vwFactKitComponentCurrent,vwFactKitComponentCurrent[Quantity]*RELATED(DimInventoryItemComponent[ComponentCurrentCost])), ALL(DimInventoryItemComponent[ComponentItemNumber]))

 

 

 

image.png

 

Ideally whatever the solution, I would then be able to filter/sort by the difference between the summed cost and the stored cost of the Kit. 

image.png

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Adding Kit Component Costs to Compare

@Anonymous ,

 

You may modify the measure using dax below:

TTL CC of Components =
CALCULATE (
    SUMX (
        vwFactKitComponentCurrent,
        vwFactKitComponentCurrent[Quantity]
            * RELATED ( DimInventoryItemComponent[ComponentCurrentCost] )
    ),
    ALL ( DimInventoryItemComponent )
)

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Anonymous
Not applicable

Re: Adding Kit Component Costs to Compare

@v-yuta-msft 

 

The issue is that now returns every component number in the component table for each master number even though the relationship table has relationships defined.

 image.png

When I don't include this measure, the components are properly listed. 

image.png

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors