Forum Discussion
gsed99
Helper III
2 years agoHelp with lookup from SELECTEDVALUE
Hello, In a calculated column, I want to return a single value from the same table based on the SELECTEDVALUE. Meaning I have a slicer and choose Account A12345 and I want to return the country for ...
gsed99
Helper III
2 years agoI've got this working via a calculated table and measure, but now I want to join in opportunity data which is joined to my account table. The problem is when I add the measure in with opportunity data it fails. Would that be a join issue or do I need to modify my measure to incorporate values from the opportunity table?
This setup works fine but only when using the Account Details table.
Table:
Cohort =
FILTER (
VALUES ( 'Account Details'[Account Number] ),
NOT ISBLANK ( 'Account Details'[Account Number] )
)
Measure:
Cohort =
var _account=CALCULATE(MAX('Account Details'[Account Number]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
var _country=CALCULATE(MAX('Account Details'[Shipping Country]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
var _industry=CALCULATE(MAX('Account Details'[Industry]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
var _Ent_Country=CALCULATE(MAX('Account Details'[Ent Name + Country]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
var _Enterprise=CALCULATE(MAX('Account Details'[Enterprise Account Name]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
var _Reg_Industry=CALCULATE(MAX('Account Details'[Region + Industry]),FILTER(ALLSELECTED('Account Details'),[Account Number]=SELECTEDVALUE('Cohort'[Account Number])))
RETURN IF(MAX('Account Details'[Account Number])=_account,"1 - Account Match",IF(MAX('Account Details'[Ent Name + Country])=_Ent_Country,"2 - Ent + Country",IF(MAX('Account Details'[Enterprise Account Name])=_Enterprise,"3 - Ent Name",IF(MAX('Account Details'[Region + Industry])=_Reg_Industry,"4 - Region + Industry",IF(MAX('Account Details'[Industry])=_industry,"5 - Industry","Other")))))
lbendlin
Super User
2 years agoPlease provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.