Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filtering a summary table based on a SELECTEDVALUE()

UPDATE: Link to sample pbix   I'm stumped. I have reviewed many third-party sources to no avail. I may very well be missing something obvious. At the end of this post is a section headed Referen...
  • DataInsights's avatar
    5 years ago

    Anonymous,

     

    Try these measures:

     

    Is Scheduled Sum = 
    VAR vSelEmp =
        SELECTEDVALUE ( 'Selected Branch'[Employee ID] )
    VAR vTable =
        FILTER (
            'Course Assignment',
            CONTAINSSTRING ( 'Course Assignment'[EmpPath], vSelEmp )
        )
    VAR vResult =
        CALCULATE ( SUM ( 'Course Assignment'[Is Scheduled] ), vTable )
    RETURN
        vResult
    
    Is Completed Sum = 
    VAR vSelEmp =
        SELECTEDVALUE ( 'Selected Branch'[Employee ID] )
    VAR vTable =
        FILTER (
            'Course Assignment',
            CONTAINSSTRING ( 'Course Assignment'[EmpPath], vSelEmp )
        )
    VAR vResult =
        CALCULATE ( SUM ( 'Course Assignment'[Is Completed] ), vTable )
    RETURN
        vResult
    
    Is Late Sum = 
    VAR vSelEmp =
        SELECTEDVALUE ( 'Selected Branch'[Employee ID] )
    VAR vTable =
        FILTER (
            'Course Assignment',
            CONTAINSSTRING ( 'Course Assignment'[EmpPath], vSelEmp )
        )
    VAR vResult =
        CALCULATE ( SUM ( 'Course Assignment'[Is Late] ), vTable )
    RETURN
        vResult

     

     

     The table visual doesn't need any filters.