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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BeginnerAnalyst
Frequent Visitor

dax calculated column with previous manager

Hi, friends,

Here is example of my table in power BI:

userperiodmanager historicalmanager actualprevious manager
user101.01.2023manager 1manager 2manager 1
user101.02.2023manager 1manager 2manager 1
user101.03.2023manager 1manager 2manager 1
user101.04.2023manager 2manager 2manager 1
user101.05.2023manager 2manager 2manager 1
user101.06.2023manager 2manager 2manager 1


green columns I already have in my table.

 

What need to do:
need to create calculated column called "previous manager".
The calculation logic for this column should be as follows: find for each user previous manager from the last date in report who was assigned to this client in the past and mark the data in the future by previous manager name.
Looks, that I need to use some window functions for this case, but can't find working solution.

I will be grateful to you for any help and advice.

1 ACCEPTED SOLUTION
BeginnerAnalyst
Frequent Visitor

created my own working solution) 

Previous manager =
CALCULATE(MAX('Revenue'[Manager actual]), FILTER('Revenue', 'Revenue'[user]=EARLIER('Revenue'[user]) && 'Revenue'[period] < EARLIER('Revenue'[period])))

View solution in original post

3 REPLIES 3
BeginnerAnalyst
Frequent Visitor

created my own working solution) 

Previous manager =
CALCULATE(MAX('Revenue'[Manager actual]), FILTER('Revenue', 'Revenue'[user]=EARLIER('Revenue'[user]) && 'Revenue'[period] < EARLIER('Revenue'[period])))
BeginnerAnalyst
Frequent Visitor

Hi) In the table there will be in future a column with revenue by each client (user column).

Users can be transferred from one manager to another in different periods.

The idea is to show report:
revenue by current manager (manager actual column) by 2 categories: 

-- revenue by users that came from current manager

-- revenue by users that came from other managers

All this is necessary for management of the company to see the overall result (revenue, MoM growth, QoQ) in the current period by the manager, as well as individual result of the manager and the result (revenue, growth) of the clients revenue transferred to him.

Anonymous
Not applicable

Hi @BeginnerAnalyst ,

I'm a little confused about your needs, Could you please explain them further? 

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.