Forum Discussion

Iamnvt's avatar
Iamnvt
Continued Contributor
5 years ago
Solved

Convert a Measure to a Calculated Column

I have 2 disconnected tables:

ProductValueLookup Column

A2?
A3?
B4?
B5?

 

and 

 

ProductValue2

A3
A2
A2
B1

 

I can create a measure to lookup and sum the value from Table 2 to Table 1:

 

Lookup Measure = CALCULATE(SUM(Table2[Value2]), TREATAS(VALUES(Table1[Product]), Table2[Product]))

 

 

How can I create a calculated column in Table 1 to have the same result as the measure above?

 

 

Here is the PBI file link: https://1drv.ms/u/s!Aps8poidQa5zmbVOuWoPQC_VC5yysw?e=XGeX4T

Thanks

  • Lookup Column = 
    CALCULATE(
        SUM( Table2[Value2] ),
        TREATAS( { ( Table1[Product] ) }, Table2[Product] )
    )

1 Reply

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion
    Lookup Column = 
    CALCULATE(
        SUM( Table2[Value2] ),
        TREATAS( { ( Table1[Product] ) }, Table2[Product] )
    )