Forum Discussion
Measure that condtional
Hi Expert,
I would like to have a measure,
Example:
| User | Code | Region | Value |
| A | A1 | UK | 1 |
| A | A1 | US | 2 |
| A | A2 | DE | 3 |
| B | A1 | UK | 4 |
| B | A1 | US | 5 |
| B | A2 | DE | 6 |
| B | A2 | UK | 7 |
| C | A1 | UK | 8 |
| C | A1 | US | 9 |
| C | A1 | DE | 10 |
| D | A2 | UK | 11 |
| D | A2 | US | 12 |
| D | A2 | DE | 13 |
(conditional that can't create column)
Expected measure: [Sum of A2] for whose user have Code "A1", so that result
| Region | Sum of A2 |
| UK | 7 |
| DE | 9 |
| total | 16 |
Many thanks,
Simon
7 Replies
- AlB
Community 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
- AnonymousNot 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
Community 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
