Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Measure that condtional

Hi Expert,

 

I would like to have a measure, 

 

Example:

UserCodeRegionValue
AA1UK1
AA1US2
AA2DE3
BA1UK4
BA1US5
BA2DE6
BA2UK7
CA1UK8
CA1US9
CA1DE10
DA2UK11
DA2US12
DA2DE13

 

(conditional that can't create column)

 

Expected measure: [Sum of A2] for whose user have Code "A1", so that result

 

RegionSum of A2
UK7
DE9
total

16

 

 

 

Many thanks,

Simon

7 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

     Hi Anonymous 

    Your result doesn't seem to match what you describe. In any case, try this:

    1. Place Region in the rows of a table visual

    2. Place Code in a  slicer and select A1

    3. Place this measure in the table visual

    Measure = SUM( Table1[Value] )

    4. You can add more slicers if you want to refine the sum further

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      AlB 
      Thanks for your reply, however that's not my expected answer. 
      I've checked my expected result is corrrect, 
      Please see the picture to be clear.

       

      Raw table

       

      Expected measure: [Sum of A2] for those user have "A1"

       

       

      Many thanks

      • AlB's avatar
        AlB
        Icon for Community Champion rankCommunity Champion

         

        Ok, but then you'd need to explain better what you need. You are leaving user D out of the calculation. Is that what you want? If so, you just have to include another slicer for User and select users A, B, C only, leaving D out

        Another option would be not to use this User slicer and embed the filtering in the measure

        MeasureV2 =
        CALCULATE ( SUM ( Table1[Value] ), Table1[User] <> "D" )

        The first option is probably more versatile, since you can select the users of interest on the fly

         

        Please mark the question solved when done and consider giving kudos if posts are helpful.

        Cheers  Datanaut