Forum Discussion

juan_pablo's avatar
juan_pablo
Helper V
1 year ago
Solved

SELECTEDVALUE inside table constructor

Hi,  I have the following measure inside a filter context where the only selected value for column 'ParameterTable'[ItmNam] is "A" (in fact it's a parameter table):   CALCULATE( COUNTROWS('Ta...
  • AlexisOlson's avatar
    AlexisOlson
    1 year ago

    Alex_Sawdo, ALLSELECTED isn't necessarily what you want (though it might be in some cases).

     

    I'd suggest one of the following instead:

     

    CALCULATE (
        COUNTROWS ( 'Table' ),
        'Table'[ItemName] IN VALUES ( 'ParameterTable'[ItmNam] )
    )
    CALCULATE (
        COUNTROWS ( 'Table' ),
        TREATAS ( VALUES ( 'ParameterTable'[ItmNam] ), 'Table'[ItemName] )
    )

     

     

    This doesn't really answer OP's question though.

    juan_pablo, in my testing, the first measure does do what you're expecting if a single parameter value is selected.