Forum Discussion

TexasXD1's avatar
TexasXD1
New Member
2 years ago
Solved

Using ALL but displaying only relevant rows

I am trying to create a visual that looks at work items, their associated work resources and displays a calculation based on their total hours assigned to jobs and weekly capacity hours to give me an available hour number. 

To do this i created a measure using ALL which works to give me correct availabe hour number however when you filter to a work item it displays all work resources and not just associated ones to that work item.

My question is that if there is a way to perform that calculation but just display the rows for the resources assigned to the work item and not all in my table. 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  TexasXD1 ,

     

    Maybe you can try formula like below to create measure:

    AvailableHours = 
    VAR TotalAssignedHours = CALCULATE(
        [TotalHours],
        ALL('WorkResources')
    )
    VAR TotalWeeklyCapacity = CALCULATE(
        [WeeklyCapacity],
        ALL('WorkResources')
    )
    RETURN
    TotalWeeklyCapacity - TotalAssignedHours
    RelevantResources = 
    CALCULATE(
        [AvailableHours],
        FILTER(
            'WorkResources',
            'WorkResources'[WorkItemID] = SELECTEDVALUE('WorkItems'[WorkItemID])
        )
    )

    Best Regards,
    Adamk Kong

     

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

     

2 Replies