Forum Discussion
ndo03001
6 years agoFrequent Visitor
LOOKUPVALUE and Nested IF
I have a database in DirectQuery where each row has a record of a specific course (COURSE: string) an individual (IND_ID: string) took in a particular period of time (YRTR). The courses have differen...
eosborn918
6 years agoNew Member
StachuJust tried your suggestion (as a new column) and received an error that the function COUNTROWS is not allowed in DirectQuery models. When I try it as a new measure instead, I get the same error as the original poster (A single value...cannot be determined). Still looking for a solution on this.
Stachu
Community Champion
6 years agothis is the version without COUNTROWS
EntryStdnt =
VAR __yrtr = TABLE1[YRTR]
VAR __ind_id = TABLE1[IND_ID]
VAR __relevant = FILTER(TABLE1,TABLE1[YRTR]=__yrtr&&TABLE1[IND_ID]=__ind_id && (TABLE1[LVL]="D" || TABLE1[LVL]="D2" ||TABLE1[LVL]="D3"))
VAR __lvl = CALCULATE(MIN('TABLE1'[LVL]),__relevant)
RETURN
IF(ISBLANK(__lvl),"Upper","Entry")
but based on this reference
you should now get error because of FILTER, as it's calculated column and not a measure. Can you test and confirm that's the case?
How do you plan to use the new column? if it's in the calculation only we could create a measure for it