cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnandAmirtharaj Frequent Visitor
Frequent Visitor

Reflect same fields twice

Hi everybody,

 

I am creating a table view in PowerBI report. Here i have to repeat the same field twice. Example 

 

column1: employee ID

column2: employee name

coumn3: manager ID

column4: manager name

 

but the database table is only one, all the names are saved in the same field in database. Here how can i repeat the name column twice in the same table view in report? attached screenshotrepeat fields.JPG

 

please help

 

best regards,

anand

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
v-yulgu-msft Super Contributor
Super Contributor

Re: Reflect same fields twice

Hi @AnandAmirtharaj,

 

In your scenario, if you want to filter all the Manager employees, you have to identify which person is a manager. I don't know how is the source table look like, I suppose the table contains an extra column to mark which one is manager.

1.PNG

 

Import the same source data twice, then you get two same table, table1 and table2.

 

In query editor, select table1. Filter data rows. And add an index column.

2.PNG 3.PNG 4.PNG

 

Select table2, add an index column. Merge these two tables.

5.PNG

 

In view mode, create a new table using below formula:

Table 2 =
SELECTCOLUMNS (
    'Reflect same fields twice',
    "EmployeeID", 'Reflect same fields twice'[Employee ID],
    "EmployeeName", 'Reflect same fields twice'[Employee Name],
    "ManagerID", 'Reflect same fields twice'[NewColumn.Employee ID],
    "ManagerName", 'Reflect same fields twice'[NewColumn.EmployeeName]
)

 

If you have any other question, please feel free to ask.

 

Best regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
Highlighted
v-yulgu-msft Super Contributor
Super Contributor

Re: Reflect same fields twice

Hi @AnandAmirtharaj,

 

In your scenario, if you want to filter all the Manager employees, you have to identify which person is a manager. I don't know how is the source table look like, I suppose the table contains an extra column to mark which one is manager.

1.PNG

 

Import the same source data twice, then you get two same table, table1 and table2.

 

In query editor, select table1. Filter data rows. And add an index column.

2.PNG 3.PNG 4.PNG

 

Select table2, add an index column. Merge these two tables.

5.PNG

 

In view mode, create a new table using below formula:

Table 2 =
SELECTCOLUMNS (
    'Reflect same fields twice',
    "EmployeeID", 'Reflect same fields twice'[Employee ID],
    "EmployeeName", 'Reflect same fields twice'[Employee Name],
    "ManagerID", 'Reflect same fields twice'[NewColumn.Employee ID],
    "ManagerName", 'Reflect same fields twice'[NewColumn.EmployeeName]
)

 

If you have any other question, please feel free to ask.

 

Best regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
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

AnandAmirtharaj Frequent Visitor
Frequent Visitor

Re: Reflect same fields twice

Hi Yuliana Gu,

 

Thank you for your valuable response. What i have done is created new data source (taking the same fields available in table1), created relationship between the 3rd column (manager) with employee id and displayed name.

 

Now its successfull !

 

Best Regards,

Anand

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 276 members 3,104 guests
Please welcome our newest community members: