Forum Discussion
PowerBi DAX Background colour: Conditonal formatting for dynamic measures with same total
That sounds like a neat idea to visually represent sales data! To achieve dynamic color changes based on the total sales amount for different cities, you can use conditional formatting in spreadsheet software like Excel or Google Sheets.
Here’s a general step-by-step approach:
Sort the Data: Arrange your sales data in descending order for each city based on the total sales amount.
Conditional Formatting: Use conditional formatting rules to assign colors to the cells containing the sales data.
- For the first highest sale amount, apply the "Red" color.
- For the second highest sale amount, apply the "Blue" color.
- For the third highest sale amount, apply the "Yellow" color.
- For the least product, apply the "Orange" color.
Apply Relative References: Ensure that the conditional formatting rules use relative references, so they adjust dynamically when you switch cities or when the data changes.
This way, whenever you switch to a different city or update the sales data, the colors will automatically adjust based on the new sales amounts for that specific city.
Chwayita-Momoza thanks for replying, I was wondering if someone has written a Power BI background colour DAX measure for this issue before.