Forum Discussion
Conditional Formatting on Data Color For Date (as Legend) in Scatter Chart
- Anonymous6 years ago
Hi,
This is not directly possible but there is a workaround. Please follow the steps given below:
You will have to create 2 columns. (You can do this in measure also by summarizing but to show demo i have implemented using 2 columns)
Column 1 Index:
Go to Edit Queries -> Sort the date column you are going to use -> Click on Add Column tab -> Index Column and create column starting from 1 with increamenting value as 1.
Column 2 Calculation:
Create column 2 with the following calculation:
Column =IF('Time'[Date] = MINX('Time', 'Time'[Date]),0,IF('Time'[Date] = MAXX('Time', 'Time'[Date]), 1,DIVIDE(1, 'Time'[Index.1],BLANK())))
Once this is done then go to the visualizations pane -> format -> data colors -> click on the white box under Default color. Then select the following options:This worked fine for me on my sample data.
Thanks,
Vinay Dandwani
Hi Vinay,
Instead of using index column, I would like to rank the date.
By any chance, do you know how to rank the date without duplicate ranking? 😥
Hi Jamie,
Please try these methods, if it works:
Method 1:
https://forum.enterprisedna.co/t/rank-unique-ranking-when-there-are-duplicate-values/2815/5
Method 2:
https://community.powerbi.com/t5/Desktop/Rank-values-without-duplicate-ranking/m-p/702312
I forgot to mention earlier, if you are using my method then please first sort the columns based on date in edit queries and then create index column.
Thanks,
Vinay Dandwani
- Jamie_wong6 years agoFrequent Visitor
Hi Vinay,
Got it! Thanks for Sharing 😊