Forum Discussion

Fcoatis's avatar
Fcoatis
Post Patron
9 years ago
Solved

Need help with this model

Hello All, I need help to create a mesure to allocate total amount of projects following specific rules as I´ll explain below:   Table 1 is a fictitious table of projects (named jobs) Table 1...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Fcoatis,

     

    You can try to use below formula if it suitable for your requirement:

    Calculate Amount = 
    var current_Amount =LOOKUPVALUE(Jobs[Amount],[Job],MAX(AllocationPorJobs[Job]))
    var current_Job=LASTNONBLANK(AllocationPorJobs[Job],[Job])
    var current_Group=LASTNONBLANK(AllocationPorJobs[Grupo],[Grupo])
    return
    IF(COUNTROWS(AllocationPorJobs)=COUNTROWS(FILTER(ALL(AllocationPorJobs),[Job]=current_Job)),current_Amount,
    	IF(current_Group="Handler",.7*current_Amount,.3*current_Amount/COUNTROWS(FILTER(ALL(AllocationPorJobs),[Job]=current_Job&&[Grupo]<>"Handler"))))

     

     

    Regards,

    Xiaoxin Sheng