Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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-many relationship in the tables
Thank you for your help !
Solved! Go to Solution.
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
Hi,
This could also work:
Column =
VAR _Lookup = [Product]
RETURN
IF (
ISBLANK ( LOOKUPVALUE ( Table2[Product], Table2[Product], _Lookup ) ),
"No",
"Yes"
)
Hi,
Measure=IF(SELECTEDVALUE(TAble1 [ID])=SELECTEDVALUE(TAble2 [ID]),"YES","NO")
Thanks,
Thennarasu
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
Hi @gerard-kouadio,
Can you please show a picture of the data model as well as explain how you want to visualize it? Which visual do you want to use and which columns do you also want to put into the visual?
Best regards
Michael
Hi,
I think you can achive this by using methods explained in this article:
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Without knowing your data or model I think you should look at the selectcolumns and natural join, treatas and/or lookup.
And at the end combine this with IF or maybe switch.
Br
Marius
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
130 | |
110 | |
93 | |
70 | |
67 |