@ziyabikram96 - Right, you could replace what you have with something like this:
CC StartDate =
SWITCH(TRUE(),
MAXX(RELATEDTABLE('CRM Log'),[CS Referred To]) = "Supply Chain",LOOKUPVALUE(....),
MAXX(RELATEDTABLE('CRM Log'),[OPS Referred To]) = "Supply Chain",LOOKUPVALUE(....),
MAXX(RELATEDTABLE('CRM Log'),[SC Referred To]) = "Supply Chain",LOOKUPVALUE(....),
BLANK()
)
The other thing that is causing your issues are your DISTINCT statements. That returns a table of values and then you are trying to use it as a scalar. That won't work and is actually probably the source of the error you are getting.
Proud to be a Super User!
@ziyabikram96 - Pretty sure you can't nest SWITCH statements like that unless you are using SWITCH(TRUE()...) I would "switch" that DAX to use a single SWITCH(TRUE()...) statement, what you have there is kind of an abomination. No offense.
Proud to be a Super User!
@ziyabikram96 , difficult to tell. check each lookup separately. it should return only one value
Proud to be a Super User!
I am trying to calculate a calculated column through this expression. The current table has one-to-many relationship with CRM Log.
@ziyabikram96 - Right, you could replace what you have with something like this:
CC StartDate =
SWITCH(TRUE(),
MAXX(RELATEDTABLE('CRM Log'),[CS Referred To]) = "Supply Chain",LOOKUPVALUE(....),
MAXX(RELATEDTABLE('CRM Log'),[OPS Referred To]) = "Supply Chain",LOOKUPVALUE(....),
MAXX(RELATEDTABLE('CRM Log'),[SC Referred To]) = "Supply Chain",LOOKUPVALUE(....),
BLANK()
)
The other thing that is causing your issues are your DISTINCT statements. That returns a table of values and then you are trying to use it as a scalar. That won't work and is actually probably the source of the error you are getting.
Proud to be a Super User!
Terrific!! Thanks alott!
User | Count |
---|---|
357 | |
198 | |
68 | |
66 | |
48 |