Forum Discussion
Anonymous
7 years agoNot applicable
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...
- 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)
jdbuchanan71
7 years agoSuper User
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)Anonymous
7 years agoNot applicable
This is perfect, thank you!