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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.