Forum Discussion
Scatter chart - define data colors on sqared defined by average lines and filters
Hi all,
I designed this report for evaluate IT Vendors based on two variables: average rating [Average Rating] and total spending [Ammontare valutato].
In the head section I have 4 dynamic filters that work on 4 different columns on the same table (SurveyPer_Struttura) where I have these 2 data plotted into scatter chart.
I added two average lines (one foreach axis).
My goal is to set color green for Vendor in square 1, grey for Vendors in squares 2 and 4 and red for Vendors in square 3.
I have understood I have to define a new measure in order to define, for each Vendor, its square, something like this:
Quadrante =
VAR AvgRating = CALCULATE(AVERAGE(SurveyPer_Struttura[Average Rating])) > CALCULATE(AVERAGE(SurveyPer_Struttura[Average Rating]))
VAR AvgAmmVal = MAX(SurveyPer_Struttura[Ammontare valutato]) > CALCULATE(AVERAGE(SurveyPer_Struttura[Ammontare valutato]))
VAR Result =
SWITCH(
TRUE(),
AvgRating && AvgAmmVal, 1,
AvgRating && AvgAmmVal = FALSE(), 2,
AvgRating = FALSE() && AvgAmmVal, 4,
AvgRating = FALSE() && AvgAmmVal = FALSE(), 3
)
RETURN Result
After I have to define a rule on data Color section based on this new measure.
I tried to use CALCULATE, AVERAGE and other functions but I was not able to complete my job.
This new measure must work when I change my selection(s) on the 4 head slicers.
I spend lot of time to search into forums and online, but at the moment I haven't found a final (and correct) solution.
Please help me 🙂
Tks in advice
2 Replies
- MFelix
Super User
- AnonymousNot applicable
Here is a solved post with similar requirement like yours and I hope it could help you solve your problem.
I think your calculation is based on your data model, please share a sample file with me and show me a screenshot with the result you want. This will make it easier for me to find the solution.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.