Forum Discussion

Patrick_Goh_YY's avatar
Patrick_Goh_YY
Regular Visitor
3 years ago
Solved

Using DAX to Create a Table

Hi Folks   Good day to you. Need some help over here.   I am trying to use a text filter visual for the Employee ID here. Has been trying to figure how can I, upon entering  the Employee ID, fil...
  • FreemanZ's avatar
    FreemanZ
    3 years ago

    hi Patrick_Goh_YY 

    try the following:

    1) plot a slicer based on a calculated table like:

    Slicer = ALL(data[Employee ID])

     2) plot a table visual with all the columns, but filter the visual with a measure like:

    measure = 
    VAR _no = 
    MAXX(
        FILTER(
            ALL(data),
            data[Employee ID]=SELECTEDVALUE(Slicer[Employee ID])
        ),
        data[NRIC NO]
    )
    RETURN
    IF(
        MAX(data[NRIC NO])=_no,
        1, 0
    )

    choose 1.

     

    it worked like:

     

  • tamerj1's avatar
    3 years ago

    Hi Patrick_Goh_YY 

    Please refer to attached sample file with the proposed solution

    FilterMeasure = 
    VAR EmpNames = 
        CALCULATETABLE ( 
            VALUES ( 'Table'[Name] ), 
            'Table'[Employee ID] IN VALUES ( Employee[Employee ID] ),
            ALL ( 'Table' )
        )
    RETURN
        COUNTROWS ( 
            FILTER ( 
                'Table',
                'Table'[Name] IN EmpNames
            )
        )