Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Multiple Criteria Lookup

Hello all, I'm pretty new to Power BI, and I'm needing some help to figure out the best way to get a result. The columns I'm working with are CALL ID, STORE #, and VISIT DATE. I need to find a funct...
  • jdbuchanan71's avatar
    jdbuchanan71
    7 years ago

    I'm not sure but I am guessing you want it as a column so you can put it in a slicer?  If so, you can add a calculated column to your table that will give you the same result:

    Column = 
    VAR StoreNum = 'Table'[STORE #]
    VAR VisitDate = 'Table'[VISIT DATE]
    VAR CallCount = 
        CALCULATE(
            COUNTROWS('Table'), 
            FILTER ( 
                'Table',
                'Table'[STORE #] = StoreNum &&
                'Table'[VISIT DATE] = VisitDate
            )
        )
    RETURN IF ( CallCount = 1, 2, 1)