Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Comparison with SIblings

Hi,

 

Need your help in solving which looks like a simple problem.

 

I have below dataset

 

CityStore Revenue
LondonL-Store 1100
LondonL-Store 2150
SydneyS-Store 1190
SydneyS-Store 275
SydneyS-Store 390
ChicagoC-Store 1300
ChicagoC-Store 2500

 

Store will go in a Slicer . When a User selects a Store from the slicer, its peers within the same city along with the Revenue should appear in a table.

 

For Example if I select S-Store 2, output should be

 

S-Store 1190
S-Store 275
S-Store 390

 

and if possible S-Store2 highlighted.

 

Thanks.

5 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Anonymous

     

    Try this technique

     

    First create a calculated table..From Modelling Tab>>New Table

    This will serve as store slicer

     

    StoreSlicer =
    VALUES ( Table1[Store ] )

    Now create this MEASURE

     

    Measure =
    VAR StoreSelected =
        SELECTEDVALUE ( 'StoreSlicer'[Store ] )
    RETURN
        CALCULATE ( MIN ( Table1[City] ), Table1[Store ] = StoreSelected )

    Not put this MEASURE in VISUAL Filter and select ISNOTBLANK

     

     

     

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks Zubair for your help.

         

        Would it be possible to do without a calculated table, on the original table.

        As every new table in the model would require the relationships to be build.