3 easy steps to use SWITCH function to make a conditional coloured bar charts in Power BI

Shashanka Shekhar
Microsoft Power BI
Published in
4 min readMar 5, 2024

--

Power BI is a platform that allows you to connect to various data sources, transform and model your data, and create interactive dashboards and reports. Power BI can help you gain insights from your data and communicate them effectively.

What are Bar Charts or Graphs?

Bar graphs, also known as bar charts, are a type of data visualization that represent data in the form of vertical or horizontal rectangular bars. The length of the bars is proportional to the measure of the data they represent. Bar graphs are a powerful tool in statistics for the presentation, analysis and interpretation of data. They make it easy to compare data and understand trends.

Photo by Campaign Creators on Unsplash

Building the Chart

We will be making this Chart:

Coloured Bar Chart

In this chart we are taking customer_region which is a categorical data in Y- axis and YoY Sales in X- axis and if YoY Sales>0 then we are assigning Green colour to bars, if YoY Sales<0 then we are assigning Red colour to bars and if YoY Sales = 0 then Blue colour.

--

--

Shashanka Shekhar
Microsoft Power BI

Contributor for Microsoft Power BI. I like Data Analysis and Data Science. Also I enjoy sports, videogames and Japanese Anime in my free time.