Forum Discussion

charliep938's avatar
charliep938
Frequent Visitor
3 years ago
Solved

Using a slicer value across a table within a measure

Hi All,   I have a table I'm using in my reports that looks like the below: Brand Name Average Sold Price Brand Variance (£) Company 1 200,000 -200,000 Company 2 500,000 100,000...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi charliep938 ,

     

    Here I suggest you to create an unrelated "Dim Brand Name" table for slicer.

    My Sample:

    Data model:

    Measure:

    Average Sold Price = CALCULATE(AVERAGE('Table'[Sold Price]))
    Brand Variance (£) = 
    VAR _SELECTBRAND =
        SELECTEDVALUE ( 'Dim Brand Name'[Brand Name] )
    VAR _SELECTAVG =
        CALCULATE ( [Average Sold Price], 'Table'[Brand Name] = _SELECTBRAND )
    RETURN
        [Average Sold Price] - _SELECTAVG

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.