Forum Discussion
How to create a measure with value from another table
- 6 years ago
Hi yukon ,
We can use the following measures to meet your requirement.
Measure 1:=SUMX(VALUES(Sell_to_Country),CALCULATE(MAX(Evaluation[PSalesAmt])))Measure 2 = IF ( ISFILTERED ( 'Evaluation'[Sell-to Country Code] ) || ISFILTERED ( 'Evaluation'[Sell-to Customer Name] ), CALCULATE ( AVERAGE ( Evaluation[PSalesAmt] ) ), MAXX ( GROUPBY ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Year], 'Calendar'[Week of Year] ), CALCULATE ( AVERAGE ( Evaluation[PSalesAvgAmt] ) ) ) )Then We can use the two measures to replace [PSalesAmt] and [PSalesAvgAmt], the result like this,
If you have any other questions, please kindly ask here and we will try to resolve it.
BTW, excel file as attached.
Best regards,
Hi yukon ,
We can use the following measures to meet your requirement.
Measure 1:=SUMX(VALUES(Sell_to_Country),CALCULATE(MAX(Evaluation[PSalesAmt])))
Measure 2 = IF (
ISFILTERED ( 'Evaluation'[Sell-to Country Code] )
|| ISFILTERED ( 'Evaluation'[Sell-to Customer Name] ),
CALCULATE ( AVERAGE ( Evaluation[PSalesAmt] ) ),
MAXX (
GROUPBY (
ALLSELECTED ( 'Calendar' ),
'Calendar'[Year],
'Calendar'[Week of Year]
),
CALCULATE ( AVERAGE ( Evaluation[PSalesAvgAmt] ) )
)
)
Then We can use the two measures to replace [PSalesAmt] and [PSalesAvgAmt], the result like this,
If you have any other questions, please kindly ask here and we will try to resolve it.
BTW, excel file as attached.
Best regards,
- yukon6 years ago
Helper I
Dear v-lid-msft ,
It's awesome and working beautiful. I was spend almost a week to get correct figure but no way. May i ask some question? Is it possible to get same figure without adding Lookup column into "Evaluation" table. It mean we directly take the value from "PlanSales" table and make it measure. I worry about the performance if we add lookup column into "Eveluation". Actually, my table has 1,048,576 rows.
Sorry for my cazy question.
Thank you so much for excel attach.
Regards,