cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AshDil
Helper IV
Helper IV

Want to show only current Vice president of Employee

Hi,

 

I have Employee hierarchy data as follows,

Vice-PresidentDirectorManagerEmployeedate
AdamJackFernandezSteve20/11/2019
AliaSamsonMikkySteve13/12/2019
BenWilliamMikkySteve15/2/2020
StokesJackMikkySteve27/03/2020
WindyWilliamFernandezSteve15/07/2020
CarlSamsonFernandezSteve20/12/2020
MarxWilliamMikkySteve1/1/2021
ShellySamsonFernandezSteve12/4/2021
WiongJackMikkySteve8/8/2021

The Date column is the day when a person has becom Vice president of Steve.
I have a employee named Steve for whom the Vice president changes with time. I want to show the latest Vice president of Steve i.e., Wiong.
I tried to calculate max date to get current Vice-president for Steve,

 

dummy =
var _latestdate = MAXX(ALLSELECTED('table'),'table'[Date])
return
_latestdate

 

but when I'm dragging Vice-President column and Employee column to visual I'm getting all Vice-Presidents of Steve and dates.

 

Please help me to do it.

 

Thanks,

AshDil.

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @AshDil ,

 

If you want to show current Vice president based on the lastest Date for each employee ,you could try:

Measure= 
var _date=MAXX(FILTER(ALL('Table'),[Employee]=MAX('Table'[Employee])),[date])
return CALCULATE(MAX('Table'[Vice-President]),ALLEXCEPT('Table','Table'[Employee]),'Table'[date]=_date)

Eyelyn9_1-1634780448704.png

Best Regards,
Eyelyn Qin
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

4 REPLIES 4
Eyelyn9
Community Support
Community Support

Hi @AshDil ,

 

If you want to show current Vice president based on the lastest Date for each employee ,you could try:

Measure= 
var _date=MAXX(FILTER(ALL('Table'),[Employee]=MAX('Table'[Employee])),[date])
return CALCULATE(MAX('Table'[Vice-President]),ALLEXCEPT('Table','Table'[Employee]),'Table'[date]=_date)

Eyelyn9_1-1634780448704.png

Best Regards,
Eyelyn Qin
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

Samarth_18
Memorable Member
Memorable Member

Sure @AshDil Let me know if its working or you find anyother difficulty.

Samarth_18
Memorable Member
Memorable Member

Hi @AshDil 

 

You can use vice president column with Last and Date with latest like below

 

Samarth_18_1-1634555517263.png

 

 

image.png

 

Thanks,

Samarth

 

 

Hi @Samarth_18 ,

Thanks for sharing. I'll work on it.

Thanks,

AshDil.

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors