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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
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
v-yuta-msft
Community Support
Community Support

@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.

Anonymous
Not applicable

@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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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