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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
drbr
Helper II
Helper II

Measure to SUM secondary column value reference, ignoring other filter context

I have a challenge to create a measure for scenario bellow, without changing the data model.

I know I could add an extra duplicate Stock table with proper relation, but I would like to solve it with a measure.

 

Thanks for any suggestion.

 

TXrZBS7

 

Tables:

Relations

Item_DIM

Item_DIMItemType_DIM
Item 1Final
Item 2Final
Item 3Raw
Item 4Raw
Item 5Raw

 

Item_STOCK

Item_STOCKItemQty_STOCK
Item 110
Item 220
Item 330
Item 440
Item 550

 

Final_Item_BOM

Item_BOMItemChild_BOMQty_BOM
Item 1Item 30,2
Item 1Item 40,3
Item 1Item 50,4
Item 2Item 31,2
Item 2Item 41,7
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@drbr 

Measure =
VAR aux_ = SELECTEDVALUE ( FINAL_Item_BOM[Item_BOM] )
RETURN
    LOOKUPVALUE ( Item_STOCK[ItemQty_STOCK], Item_STOCK[Item_STOCK], aux_ )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

@drbr 

Measure =
VAR aux_ = SELECTEDVALUE ( FINAL_Item_BOM[Item_BOM] )
RETURN
    LOOKUPVALUE ( Item_STOCK[ItemQty_STOCK], Item_STOCK[Item_STOCK], aux_ )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Thank you!
Simple, yet effective! 👍

AlB
Community Champion
Community Champion

Hi @drbr 

Measure =
VAR aux_ = SELECTEDVALUE ( Item_STOCK[Item_STOCK] )
RETURN
    LOOKUPVALUE ( Item_STOCK[ItemQty_STOCK], Item_STOCK[Item_STOCK], aux_ )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Thank you very much.

Measure unfortunatelly does not return proper vaules.

It is a little more complex, as LOOKUPVALUE is not Item_STOCK item, but item from it's father on Final_Item_BOM?

FbGnexl

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.