Forum Discussion
Anonymous
6 years agoNot applicable
Add dimension within addcolumn union
Hello! I made 2 manual dimension tables, named 'Company' and 'Teams'. Also made a calculated table as shown below. With this table I'm able to merge 'Sales' and 'Costs' within the same table. ...
- 6 years ago
hi Anonymous
You could use this formula as below:
Table = UNION( ADDCOLUMNS( 'Company', "Team", "", "Type", "Sales", "TestMeasure", TODAY() ), ADDCOLUMNS( GENERATE('Company',FILTER(Team,Team[Team]<>3)), "Type", "Costs", "TestMeasure", NOW() ))Result:
Regards,
Lin
amitchandak
Super User
6 years agoAnonymous , It should work by giving column name like
Facts =
UNION(
selectCOLUMNS(Table1,"Company";
Table[Company];
"Type"; "Sales";
"Team"; "";
"TestMeasure"; ...
);
selectCOLUMNS(Table1,"Company";
Table[Company];
"Type"; "Costs";
"Team"; Table[Team];
"TestMeasure"; ...
))
Anonymous
6 years agoNot applicable
amitchandak thanks for your reply!
Maybe im missing something, but addcolumns expects an expression. Table[team] is not an expression.
I tried a lot of different expressions, but I'm not able to find the correct one.
The best one I found was RELATED('Team'[Team]). Unfortunatly this gave the result below.
| Company | Type | Team |
| A | Sales | |
| B | Sales | |
| A | Costs | 1 |
| B | Costs | 2 |
- amitchandak6 years ago
Super User
Anonymous , can you share source data. You have already shared desired output
- Anonymous6 years agoNot applicable
https://drive.google.com/open?id=1j9UOmy1cjbrjXREJSoY-_elkrwxj2ACX
If a relation between tables is necessary, feel free to suggest.