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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SelflearningBi
Helper III
Helper III

How to append columns in the same table and add a new column to create slicer?

SelflearningBi_0-1655213226625.png

I am new to powerbi. I got above table, I would like to make above table into following table, and create a slicer callled  Responsible which I could filter Apple, Banana, Peach. 


My Database(Above Table) doesn't include Resonsible either, how do I add this column and make orange column and green column append below yellow table? 

SelflearningBi_1-1655213267651.png

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @SelflearningBi ,

Pls refer the below:

base table:

vluwangmsft_0-1655449750356.png

Then use the below to calculate new table:

 

Table 2 = 
UNION (
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email],
        "Job Tile", 'Table'[Job Title],
        "Name school", 'Table'[Name_School1],
        "telephone", 'Table'[Telephone],
        "Resonsible", "Apple"
    ),
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email2],
        "Job Tile", 'Table'[Job Title2],
        "Name school", 'Table'[Name_School2],
        "telephone", 'Table'[Telephone2],
        "Resonsible", "Banana"
    ),
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email3],
        "Job Tile", 'Table'[Job Title3],
        "Name school", 'Table'[Name_School3],
        "telephone", 'Table'[Telephone3],
        "Resonsible", "Peach"
    )
)

 

 

vluwangmsft_1-1655450806771.png

 

 

Then create the below measure:

 

 

color = IF(MAX('Table 2'[Resonsible])="Apple","Yellow",IF(MAX('Table 2'[Resonsible])="Banana","Orange","Green"))

 

vluwangmsft_2-1655451099978.png

vluwangmsft_3-1655451154931.png

 

Final Output result:

vluwangmsft_4-1655451171660.png

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @SelflearningBi ,

Pls refer the below:

base table:

vluwangmsft_0-1655449750356.png

Then use the below to calculate new table:

 

Table 2 = 
UNION (
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email],
        "Job Tile", 'Table'[Job Title],
        "Name school", 'Table'[Name_School1],
        "telephone", 'Table'[Telephone],
        "Resonsible", "Apple"
    ),
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email2],
        "Job Tile", 'Table'[Job Title2],
        "Name school", 'Table'[Name_School2],
        "telephone", 'Table'[Telephone2],
        "Resonsible", "Banana"
    ),
    SELECTCOLUMNS (
        'Table',
        "Email", 'Table'[Email3],
        "Job Tile", 'Table'[Job Title3],
        "Name school", 'Table'[Name_School3],
        "telephone", 'Table'[Telephone3],
        "Resonsible", "Peach"
    )
)

 

 

vluwangmsft_1-1655450806771.png

 

 

Then create the below measure:

 

 

color = IF(MAX('Table 2'[Resonsible])="Apple","Yellow",IF(MAX('Table 2'[Resonsible])="Banana","Orange","Green"))

 

vluwangmsft_2-1655451099978.png

vluwangmsft_3-1655451154931.png

 

Final Output result:

vluwangmsft_4-1655451171660.png

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

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 Kudoed Authors