Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am trying to write a measure that will aggregate two separate rows of data for analysis or alternatively merge the rows together.
My data look like this:
Briefly, during the process of billing, hours and fees are "relieved," i.e., moved from WIP to accounts receivable. When the bill is paid, usually at a later date, the FeeAmtPaid is entered in a separate row under the same billing number, which removes that amount from accounts receivable. Hence, whenever there is a payment there will be at least two rows under the same bill number. (If the bill is paid in multiple increments, there can be >2 rows for the same bill number.)
Is it possible to write a measure that aggregates the "relieved" row and the "paid" row(s) together in order to calculate FeeAmtPaid in 2017 no matter when the fees and hours were relieved? Alternatively, it there a way to merge the two rows together? (I am no "M Code" expert unfortunately.)
Solved! Go to Solution.
Ooops. Forgot the last measure to get only the 2017 aggregate paid fees per hour:
2017 FeesPerPaidHourAggregate = CALCULATE ( [FeesPerPaidHourAggregate], FILTER ( Table, [Date Paid Year] = 2017 ) )
I should have added that I would like to take the FeeAmtPaid in the current year and divide it by the HoursRelieved in order to arrive at an effective (paid) billing rate per hour. This is why I need the HoursRelieve and the FeeAmtPaid on the same row.
Thanks.
I appear to have found a workable solution by brute force of trial and error.
This measure aggregates the FeeAmtPaid on the different rows:
FeeAmtPaidAggregate =
CALCULATE (
SUM ( Table[FeeAmtPaid] ),
ALLEXCEPT ( Table, Table[BillNumber] )
)
This measure aggregates the HoursRelieved on the different rows:
HoursRelievedAggregate = CALCULATE ( SUM ( Table[HoursRelieved] ), ALLEXCEPT ( Table, Table[BillNumber] ) )
This calculates the effective billing rate in 2017:
FeesPerPaidHourAggregate = DIVIDE ( [FeesPaidAggregate], [HoursRelievedAggregate] )
I would be interested in any critique of this approach.
Ooops. Forgot the last measure to get only the 2017 aggregate paid fees per hour:
2017 FeesPerPaidHourAggregate = CALCULATE ( [FeesPerPaidHourAggregate], FILTER ( Table, [Date Paid Year] = 2017 ) )
User | Count |
---|---|
84 | |
79 | |
63 | |
62 | |
51 |
User | Count |
---|---|
120 | |
99 | |
91 | |
83 | |
65 |