Forum Discussion
Scatter Plot Legend Color: Based on Multiple Field Value and Create Multiple Rules
Hi,
The current setup is only for one field. But I want the legend color shown by different colors with different rules. Is there any way by using DAX to solve this problem?
Thanks.
- Anonymous4 years ago
HI zakkyang,
I'd like to suggest you do 'unpivot columns' on your value fields to convert them to attribute and value.
Unpivot columns (Power Query) (microsoft.com)
Then you can put attributes on legend fields, value on value fields with DAX expression(use if statement checks both attribute and value fields) to apply conditional formatting to multiple fields.Regards,
Xiaoxin Sheng
2 Replies
- amitchandakSuper User
zakkyang , You can create a color measure and use that in conditional formatting using field value option
example
Color = if(FIRSTNONBLANK('Table'[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")
refer
How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4
Scatter : Customers to Retain- Segment in 4 quadrant based on Margin % and Discount %: https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-4-Customers-to-Retain-Segment-in-4/ba-p/1421632
- AnonymousNot applicable
HI zakkyang,
I'd like to suggest you do 'unpivot columns' on your value fields to convert them to attribute and value.
Unpivot columns (Power Query) (microsoft.com)
Then you can put attributes on legend fields, value on value fields with DAX expression(use if statement checks both attribute and value fields) to apply conditional formatting to multiple fields.Regards,
Xiaoxin Sheng