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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Super User
Super User

@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
Super User
Super User

@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
Super User
Super User

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors