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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Yrstruly2021
Helper V
Helper V

Adding and Linking a column

1. I would like to add an employee column to the Revenue table like in the Salaries table, please assist?

 2. Is the calendar table neccesary, if the Revenue table has got a created date?

 

see pbix: https://drive.google.com/file/d/1KN2fmGx9hsuJaaX0lN5p0NZl_wkhliwE/view?usp=sharing 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Yrstruly2021 

I have saw your sample, and I will give you some advice for your two questions.

1. You want to add an employee column to Revenue table.

I have two way to build a calculated column to achieve your goal.

Firstly one is to get Employee from other table like Salaries table. But by this way, you need at least a key column in both table to build this calculated column.

Code is similar as below. 

 

Employee =
CALCULATE (
    MAX ( Salaries[Employee Name] ),
    FILTER ( Salaries, Salaries[Key Column] = EARLIER ( Revenue[Key Column] ) )
)

 

Or you can try Merge function in Power Query, if you have multipe Employee for same Key Column.

For reference: Combine queries

The second one is to build a calculated column by If function for Revenue table, you need a Key column in Revenue table as well.

Ex:

 

Employee = SWITCH(Revenue[Key Column],"Value1","Employee1","Value2","Employee2"...)

 

 

2. If you want to use time intelligence function in dax, or build some visuals with continuous date, you need to build a calendar table with continuous date. So I think a calendar table is necessary for you to build a report.

 

If this reply still couldn't help you solve your problem, please show me more details about your logic and the result you want.

 

Best Regards,
Rico Zhou

 

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
Anonymous
Not applicable

Hi @Yrstruly2021 

I have saw your sample, and I will give you some advice for your two questions.

1. You want to add an employee column to Revenue table.

I have two way to build a calculated column to achieve your goal.

Firstly one is to get Employee from other table like Salaries table. But by this way, you need at least a key column in both table to build this calculated column.

Code is similar as below. 

 

Employee =
CALCULATE (
    MAX ( Salaries[Employee Name] ),
    FILTER ( Salaries, Salaries[Key Column] = EARLIER ( Revenue[Key Column] ) )
)

 

Or you can try Merge function in Power Query, if you have multipe Employee for same Key Column.

For reference: Combine queries

The second one is to build a calculated column by If function for Revenue table, you need a Key column in Revenue table as well.

Ex:

 

Employee = SWITCH(Revenue[Key Column],"Value1","Employee1","Value2","Employee2"...)

 

 

2. If you want to use time intelligence function in dax, or build some visuals with continuous date, you need to build a calendar table with continuous date. So I think a calendar table is necessary for you to build a report.

 

If this reply still couldn't help you solve your problem, please show me more details about your logic and the result you want.

 

Best Regards,
Rico Zhou

 

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

ryan_mayu
Super User
Super User

@Yrstruly2021 

not clear about your request. Usually we should have a employee code colun in Revenue or something like that column and you need to have an employee dim table. Then you can connect two tables.

Could you pls elaborate how to get the employee info? 

 





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

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.