Forum Discussion
DeoYadav
4 years agoRegular Visitor
Calculated table using DAX
How to get the result as below. EMP_table Department_table Result Table EmpId Name DepName 1 Raj IT 2 Kishor HR 2 Abhi FR 4 Kiran No Department ...
- 4 years ago
Hi DeoYadav,
I use selectedcolumns() to do this.
Result Table = SELECTCOLUMNS ( 'EMP_table', "empid", [new EmpID], "name", [Name], "DepName", IF ( ISBLANK ( RELATED ( Department_table[DepName] ) ), "No Department", RELATED ( Department_table[DepName] ) ) )Result:
Pbix in the end you can refer.Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ValtteriN
4 years agoCommunity Champion
Hi,
Your department table had a duplicate id. I will ignore it in my example.
Here is one way to do this:
Table 6 = ADDCOLUMNS(EMP_table,"Department",RELATED(Department_table[DepName]))
If you want to differentiate between HR and FR the depID's should be unique.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
If you want to differentiate between HR and FR the depID's should be unique.
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
- Anonymous4 years agoNot applicable
Hi ValtteriN tables can have multiple ids where we use M:M relationship in our model, correct? so what would be result in the case of M:M, can we get the result as shown in the result table?