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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
selected_
Helper IV
Helper IV

Salary revision still showing for 2024 but none salary revision was actually made

i have couple column that show currentSalary and prevSalary in a table, i wanna create another column and see the % of how much is difference in increase or decrease or if it not any changes at the salary between these two columns, but take consideration to the dates since i have different columns with dates like startDate, endDate and lastmodifiedDate If anyone gets a salary revision, Startdate defines from when the revision is effective. EndDate is when the Current Salary change gets over and day after that another salary change. For current salary, enddate is 9999-12-31 Lastmodified date defines when the change was made.

 

 I tried to create a simple measure like dividing the DIVIDE(([Current] - [Prev] 

 

but that shows figures for year 2024 when employees didn't had any revision yet so i dont know where it gets those figures from, so i guess in my measure i didnt take considration to those date columns in the tbale maybe? 

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @selected_ 

I create a sample table:

vyohuamsft_1-1715914705013.png

 

Maybe you can try the following dax, create measures:

Effective Start Date = MAX('Table'[Start Date])

Effective End Date = IF(MAX('Table'[End Date]) = DATE(9999, 12, 31), TODAY(), MAX('Table'[End Date]))

Salary Difference = SUM('Table'[Current Salary])-SUM('Table'[Previous Salary])

Filtered Salary Difference = 
VAR CurrentEmployee = SELECTEDVALUE('Table'[Employee ID])
RETURN
CALCULATE(
   'Table'[Salary Difference],
    FILTER(
        'Table',
        'Table'[Employee ID] = CurrentEmployee &&
        'Table'[Last Modified Date] = MAX('Table'[Last Modified Date]) &&
        'Table'[Start Date] <= [Effective End Date] &&
        'Table'[End Date] >= [Effective Start Date]
    )
)

Percentage Change = [Filtered Salary Difference]/SUM('Table'[Previous Salary])

 

Here is my preview:

vyohuamsft_0-1715914673720.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

1 REPLY 1
v-yohua-msft
Community Support
Community Support

Hi, @selected_ 

I create a sample table:

vyohuamsft_1-1715914705013.png

 

Maybe you can try the following dax, create measures:

Effective Start Date = MAX('Table'[Start Date])

Effective End Date = IF(MAX('Table'[End Date]) = DATE(9999, 12, 31), TODAY(), MAX('Table'[End Date]))

Salary Difference = SUM('Table'[Current Salary])-SUM('Table'[Previous Salary])

Filtered Salary Difference = 
VAR CurrentEmployee = SELECTEDVALUE('Table'[Employee ID])
RETURN
CALCULATE(
   'Table'[Salary Difference],
    FILTER(
        'Table',
        'Table'[Employee ID] = CurrentEmployee &&
        'Table'[Last Modified Date] = MAX('Table'[Last Modified Date]) &&
        'Table'[Start Date] <= [Effective End Date] &&
        'Table'[End Date] >= [Effective Start Date]
    )
)

Percentage Change = [Filtered Salary Difference]/SUM('Table'[Previous Salary])

 

Here is my preview:

vyohuamsft_0-1715914673720.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.