Forum Discussion
Anonymous
7 years agoNot applicable
Average based on related value to selected
Hi everyone
I have a data set that looks like the below.
What I'm after is to be able to display the average price for the location in which the selected customer resides. In an ideal world I'd have a slicer in which an end user can select e.g. "Joe Bloggs" and then have a measure into a card which would display the average price of people in London, e.g. £163.75.
Hoping someone can help with what this measure would look like as I'm a bit stuck!
Thanks
| Customer Name | Location | Price |
| Joe Bloggs | London | £100.00 |
| Dan Smith | Newcastle | £50.00 |
| Susie Campbell | Newcastle | £78.00 |
| Kylie Minogue | Brighton | £135.00 |
| David Beckham | London | £180.00 |
| Theresa May | London | £250.00 |
| Beyonce | London | £125.00 |
Anonymous try this measure
Avg = VAR __location = MAX( Table2[Location] ) RETURN CALCULATE( AVERAGE( Table2[Price] ),ALL(Table2 ), Table2[Location] = __location )
2 Replies
- parry2k
Super User
Anonymous try this measure
Avg = VAR __location = MAX( Table2[Location] ) RETURN CALCULATE( AVERAGE( Table2[Price] ),ALL(Table2 ), Table2[Location] = __location )
- AnonymousNot applicable
Thank you!!