Forum Discussion
gerard-kouadio
3 years agoHelper I
create new column from 2 tables using if function
Hello, I have 2 tables and I want to create a column from the ids of the 2 tables. I want to do something like this: if id of table 1 = id of table 2, put yes, if no, put No. NB: there is a many-to...
- 3 years ago
HI gerard-kouadio ,
Pls refer the below sample:
tableA:
Table B:
Column = var Q1 = TableA[ID] var NewCol = CALCULATE(MAX('Tableb'[ID]),Tableb[ID]=Q1) return IF(NewCol<>BLANK(),1,BLANK())Best Regards
Lucien
- 3 years agoI finally used this code:New colomn = if(ISBLANK(LOOKUPVALUE('Table1'[Id], 'Table1'[Id],Table2[Id])),"Non","Oui")
mariussve1
3 years agoSolution Sage
Hi,
This could also work:
Column =
VAR _Lookup = [Product]
RETURN
IF (
ISBLANK ( LOOKUPVALUE ( Table2[Product], Table2[Product], _Lookup ) ),
"No",
"Yes"
)