Forum Discussion

kenneth0596's avatar
kenneth0596
Frequent Visitor
6 years ago
Solved

Calculating Monthly Salary

Hi everybody,   My finance dept has a payroll calendar, there are two columns, one is cut off date and the other one is actual pay date. If anyone joined the company before the cut off date then he...
  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    hi kenneth0596 

    You could create these three measure for it.

    Measure 2 = DATEDIFF(MAX('Table'[Join date]),MAX('payroll calendar'[Cut off]),DAY)
    Measure 3 = DATEDIFF(MAX('payroll calendar'[Cut off]),MAX('payroll calendar'[Pay date]),DAY)
    Measure 4 = IF([Measure 2]>0,IF([Measure 2]<[Measure 3],[Measure 2],[Measure 3]))
    (You could combine them into one formula)
    Then drag Emp field into visual too.
    Now, add a daily salary in the fact emp table that used it calculate salary by day.
     

    Regards,

    Lin