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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ramees_123
Helper IV
Helper IV

Measure to Calculate the Pending Amounts

Hi, Please find the below employees incentive table. We need to create a measure for the field Final Payout.

 

Company does not release if the incentive achieved is < 100, instead it will add it to the next month payout.

 

In the below example Empoyee 1024 achieved incentive for Jan 2021, Feb 2021 and April 2021. He didn't achieve any for Mar 2021 due to some reasons.

 

For Jan he achieved only 30, so final payout is 0. For Feb he achieved only 35 and if we add up the previous incentive then we goet only 65, so final payout is 0. For March, he didn't have any entry. For April he achived 40 and when we sum up previous pendings of 30 and 35, then the toal final payout is 105 and he receives it since it is greater than 100.

 

How to create this type of measure. Please help. This table will have records for multiple employee IDs and months and years.

 

Employee IDMonth - YearIncentive AchievedFinal Payout
1024Jan-21300
1024Feb-21350
1024Apr-2140105

 

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

Hi Ramees_123,

 

Try this measure

Final Payout measure = 
VAR IF_gr100=CALCULATE(SUM('TABLE'[Incentive Achieved]),
    FILTER(all('TABLE'), 
        'TABLE'[Month - Year]<=MAX('TABLE'[Month - Year])&& 'TABLE'[Employee ID]=MAX('TABLE'[Employee ID])
    )
)
return
IF(IF_gr100>=100,IF_gr100,0)

 

 vchenwuzmsft_0-1631064145801.png

 

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

This is not as easy as you have made it out in the 3 rows example.  For employee 1024, please take a more comprehensive example with multiple Final payouts during the year to fortify the logic and understanding.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-chenwuz-msft
Community Support
Community Support

Hi Ramees_123,

 

Try this measure

Final Payout measure = 
VAR IF_gr100=CALCULATE(SUM('TABLE'[Incentive Achieved]),
    FILTER(all('TABLE'), 
        'TABLE'[Month - Year]<=MAX('TABLE'[Month - Year])&& 'TABLE'[Employee ID]=MAX('TABLE'[Employee ID])
    )
)
return
IF(IF_gr100>=100,IF_gr100,0)

 

 vchenwuzmsft_0-1631064145801.png

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors