Forum Discussion

sjhand's avatar
sjhand
Frequent Visitor
3 years ago

Converting a payroll data Measure into a Table Column

Hi there,

I am looking to find a way to speed up a measure that converts bi-weekly data into monthly. But the problem is that the measure takes a long time to calculate with the amount of data. I think that the best solution is to pre-calculate into table columns. So, I am looking to host the measure's end result as a table column (or two?) for a faster payroll report, and to be able to share the table with other reports.

 

I am working with payroll data, which comes on a bi-weekly basis. The measure below takes this bi-weekly data, and converts into monthly. In the measure, [Bi-Weekly Earnings] is my data field, and I have Start & End date fields that specify the dates covered by the payroll. I got this measure with help from this forum.

 

~Bi-Weekly Earnings by Month =

CALCULATE(

     SUMX(

          SUMMARIZE(

               filter(

                    CROSSJOIN('2022 Payroll Reports','Date'),

                    'Date'[Date] >= '2022 Payroll Reports'[2022 Payroll Calendar.Start Date] && 'Date'[Date] <=

                    '2022 Payroll Reports'[2022  Payroll Calendar.End Date]),'2022 Payroll Reports'[Index],'Date'[Date],

                    '2022 Payroll Reports'[[Bi-Weekly Earnings]]],'2022 Payroll Reports'[2022 Payroll Calendar.Start Date],

                    '2022 Payroll Reports'[2022 Payroll Calendar.End Date]),

 

                DIVIDE('2022 Payroll Reports'[[Bi-Weekly Earnings]]],

                      DATEDIFF('2022 Payroll Reports'[2022 Payroll Calendar.Start Date],

                      '2022 Payroll Reports'[2022 Payroll Calendar.End   Date],day)+1)

     )

)

 

Visual of raw data:

The result of the measure:

 

How can I convert this measure into a table column? Since many payrolls overlap two months, do I need two or more columns to hold the amounts for each month?

 

2 Replies