Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar/Column chart colour formating using simple Dax functions

Requirement : Lets say we have a requirement where we want to show bar chart in two different colours alternately.
In this scenario, lets say we have a simple data and we want to do formatting of of bar chart in specific colour and order then with the help of index column and simple dax function we can acheive this.
For this, just create a simple index table like this which is shown below








As we want alternate colour we will add index column and using that we will add colour columns.
Go to edit queried and add index columns.









Once Index column is added create new column using following DAX function


colour = IF('Sample data'[Index.1] = ODD('Sample data'[Index.1]),1,2)








This will bring 1 and 2 in clront of each row. Once we get this column go to Report Pane and select Bar chart.

Then, in the Format pane go to Data colurs and select connditonal formating option as follows,


Final Output:
NOTE: You can create colour column according to amont or values as well as per  the requireement.
Hope, this will help you in formatting for Bar/Column chart.
Thanks and Regards,
Ashwin Kulkarni, BI Consultant
Nice Software Solutions,
Address: 21, IT Park, Wing – A, Ground Floor,
Gayatri Nagar, NAGPUR - 440022 (India)
Mobile: 0712 664 4575

Helpful resources

June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors