Forum Discussion

M_Ulloa's avatar
M_Ulloa
Frequent Visitor
1 year ago
Solved

Measure using slicer value in two different ways

Hi data gurus,   I have an issue that I'm hoping one of you may be able to help with. With the following test data:   Initiating Org Ending Org Count A B 1 B B 32 C B 1 D ...
  • rohit1991's avatar
    1 year ago

    Hi M_Ulloa

     

    The issue with your Measure3 returning the same value across all rows stems from the use of SELECTEDVALUE, which doesn't behave as expected when used in a row-level evaluation within a table visual. Instead, you’ll want to leverage the current row context to dynamically reference the “Initiating Org” rather than relying solely on the slicer’s value.

     

    Could you please modify your Measure 3 like this:

    Measure3 = 
    CALCULATE(
        [Count],
        FILTER(
            ALL(myTable),
            myTable[Initiating Org] = EARLIER(myTable[Initiating Org]) &&
            myTable[Ending Org] = SELECTEDVALUE(myTable[Ending Org]) &&
            myTable[Initiating Org] <> myTable[Ending Org]
        ))
    

     

    Alternatively, consider using a calculated column if you're looking to simplify row-level logic.