Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not 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.

 

But, for 'Costs' I would like to a column as subdimension 'Teams'. Unfortunatly, can't make this work 🤦‍.

I would like to achieve this without using relationships between tables.

 

Hopefully this makes sense and somebody is able to help me out! Thanks a lot.

 

 

 

 

 

Facts = 
UNION(
    ADDCOLUMNS(
        'Company';
        "Type"; "Sales";
        "Team"; "";
        "TestMeasure"; ... 
    );
        ADDCOLUMNS(
        'Company';
        "Type"; "Costs";
        "Team"; "🤦‍";
        "TestMeasure"; ...
))

 

 

 

 

 

Desired result:

CompanyTypeTeam
ASales 
BSales 
ACosts1
BCosts1
ACosts2
BCosts2
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

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:

5.JPG

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

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:

5.JPG

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks a lot!

The application of the generate function is what I was looking for. 

You even filtered out team 3 from my example to get the desired result 😉

amitchandak
Super User
Super User

@Anonymous , 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"; ...
))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not 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.

CompanyTypeTeam
ASales 
BSales 
ACosts1
BCosts2

 

 

@Anonymous , can you share source data. You have already shared desired output

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

https://drive.google.com/open?id=1j9UOmy1cjbrjXREJSoY-_elkrwxj2ACX 

 

If a relation between tables is necessary, feel free to suggest.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors