Forum Discussion
Need Help On Creating a Column from two linked Data sources
Hi Guys,
I really Need Help Here to Convert This in Tableau to Power BI. Scenario is If I have two Tables In Tableau Like:
Table1
| Student | Marks |
| A | 80 |
| B | 90 |
| C | 100 |
| D | 50 |
| E | 45 |
and
| Student | Age |
| A | 12 |
| B | 13 |
| C | 14 |
and I bulid Relationship in Tableau on Student then I would write a Calculation Such as
IF (ATTR(Student from Source 1)=ATTR(Student from Source2) THEN 1 ELSE 0 END
This would Return a Column In Table 1 as
| Student | Marks | Result |
| A | 80 | 1 |
| B | 90 | 1 |
| C | 100 | 1 |
| D | 50 | 0 |
| E | 45 | 0 |
Please give me equivalent formula in Power BI
Thanks
Deepak
Create a calculated column in Table1 using the formula below
if(calculate(countrows(table2),filter(table2,table2[Student]=table1[Student]))>0,1,0)
3 Replies
- NishantjainContinued Contributor
Create a calculated column in Table1 using the formula below
if(calculate(countrows(table2),filter(table2,table2[Student]=table1[Student]))>0,1,0)
- v-xjiin-msftSolution Sage
Hi drrai66,
To achieve your requirement, you can try this:
1. Create a relationship between Source1 and Souce2.
2. Create a measure like:
Result = IF ( ISBLANK ( CALCULATE ( MAX ( Source2[Age] ) ) ), 0, 1 )
Thanks,
Xi Jin.- drrai66Resolver I
Yours Solution Looks pretty good, but the first formula gave me what I needed in my Actual Data set. Thanks for your Time !!!
Deepak