Forum Discussion
Mani_1
3 years agoFrequent Visitor
Adding coloumn to table based on filter
Hi,
I am trying to add a coloum company in table 1 based only with type "a", I have tried various dax measure but didn't succeed. Please help me with issue. The data is as follows,
Thanks in advance
amitchandak Greg_Deckler parry2k
Table 1:
| File |
| 123 |
| 456 |
| 789 |
| 917 |
| Company | Type | File |
| XX company | ar | 123 |
| Xy company | a | 123 |
| bS company | ar | 456 |
| XZ company | a2 | 456 |
| by company | a | 456 |
| ca company | a3 | 789 |
| ce company | a | 789 |
| cf company | a3 | 917 |
| dl company | a | 971 |
Mani_1 assuming there is relationship between Table1 and Company table, and the relationship is 1 to many (one on Table1 side), add following calculated column in Table1
Company = VAR __Table = SELECTCOLUMNS ( FILTER ( RELATEDTABLE ( Company ), Company[Type] = "A" ), "@Company", Company[Company] ) RETURN MINX ( __Table, [@Company] )
3 Replies
- parry2k
Super User
Mani_1 assuming there is relationship between Table1 and Company table, and the relationship is 1 to many (one on Table1 side), add following calculated column in Table1
Company = VAR __Table = SELECTCOLUMNS ( FILTER ( RELATEDTABLE ( Company ), Company[Type] = "A" ), "@Company", Company[Company] ) RETURN MINX ( __Table, [@Company] )