I have a scatter plot of Products. The scatter plot has the axis Profitability Vs Popularity (No of Items Sold). Initial dataset is in the following format.
Date, Product, Profit ,ItemsSold
and so on.
Then i plot the products on the scatter plot. where X-axis=Sum[Profit] Y-axis=Sum[ItemsSold]
Then i am creating following measures to group the products.
TotalProfit = SUM(PRICE_LEVEL[Profit])
AllProfit = CALCULATE(SUM(PRICE_LEVEL[Profit]),ALLSELECTED(PRICE_LEVEL[Product]))
Profitability Margin = CALCULATE(DIVIDE([TotalProfit],[TotalPortionsSold]),ALLSELECTED(PRICE_LEVEL))
TotalPortionsSold = SUM(PRICE_LEVEL[ItemsSold])
AllPortionsSold = CALCULATE(SUM(PRICE_LEVEL[ItemsSold]),ALLSELECTED(PRICE_LEVEL[Product]))
NumberofMaterial = CALCULATE(DISTINCTCOUNT(PRICE_LEVEL[MATERIAL]),ALLSELECTED(PRICE_LEVEL))
Popularity Margin = CALCULATE(DIVIDE([TotalPortionsSold],[NumberofMaterial])*0.7,ALLSELECTED(PRICE_LEVEL))
Then I categorize Products as high and Low Profitable and Popular as follows.
Profitabilty = if([TotalProfit]< [Profitability Margin],"L","H")
Popularity = if([TotalPortionsSold]<[Popularity Margin],"L","H")
Then Based on H and L combinations I give names to those categories. Basically i need to divide products in to four categories. I have done it using following measure.
Quadrant = CALCULATE(if([Profitabilty]="H" && [Popularity]="H","Q1",if([Profitabilty]="H" && [Popularity]="L","Q2",if([Profitabilty]="L" && [Popularity]="H","Q3","Q4"))))
Now i need to color code the scatter plot based on the above quadrant.
My question is i cannot add [Quadrant] to the legend as it is a measure.
Does any one of you know how can i achieve this?
Current scatter visual not support color code and use measure as legend, I'd like to suggest you submit this to ideas.
BTW, your formula contains calculation which based on visual filter, so it is impossible to convert them to calculate column.
Thanks for the reply.
I perform the calculations on aggredated data. That is why i cannot create calculated columns.
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!
Check out what's new in the Power BI Community!