Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I need your help creating a correct Compensation End date for my data.
Employee Id | Employee Name | Compensation Start Date |
100010 | David Mayer | 01/01/2020 |
100010 | David Mayer | 12/14/2020 |
100010 | David Mayer | 02/01/2021 |
100010 | David Mayer | 07/01/2021 |
100290 | Jessi Park | 06/08/2020 |
100290 | Jessi Park | 05/01/2021 |
I created a calculated column:
Employee Id | Employee Name | Compensation Start Date | Compensation End Date | Expected Compensation End Date |
100010 | David Mayer | 01/01/2020 | 06/302021 | 12/13/2020 |
100010 | David Mayer | 12/14/2020 | 06/302021 | 01/31/2020 |
100010 | David Mayer | 02/01/2021 | 06/30/2021 | 06/30/2021 |
100010 | David Mayer | 07/01/2021 | ||
100290 | Jessi Park | 06/08/2020 | 04/30/2021 | 04/30/2021 |
100290 | Jessi Park | 05/01/2021 |
Solved! Go to Solution.
Hi,
Perhaps this:
Compensation End Date =
VAR NextDate =
CALCULATE (
MIN ( Compensation[Compensation Start Date] ),
FILTER (
Compensation,
Compensation[Employee Id] = EARLIER ( Compensation[Employee Id] )
&& Compensation[Compensation Start Date]
> EARLIER ( Compensation[Compensation Start Date] )
)
)
RETURN
IF ( NextDate = 0, BLANK (), NextDate - 1 )
Regards
You're very welcome!
Cheers
Hi,
Perhaps this:
Compensation End Date =
VAR NextDate =
CALCULATE (
MIN ( Compensation[Compensation Start Date] ),
FILTER (
Compensation,
Compensation[Employee Id] = EARLIER ( Compensation[Employee Id] )
&& Compensation[Compensation Start Date]
> EARLIER ( Compensation[Compensation Start Date] )
)
)
RETURN
IF ( NextDate = 0, BLANK (), NextDate - 1 )
Regards
@Jos_Woolley It worked perfectly!! Thank you so so much for taking the time to solve my problem! 😊
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |