<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Data Visualization with Rule Based Color in Column Graph in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2664014#M79082</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="400299" data-lia-user-login="arafmustavi" class="lia-mention lia-mention-user"&gt;arafmustavi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. IF you want the whole consumed bar to become green or red:&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp; mentioned before, you can use conditional formatting to change the color. However if you want to generate a Bar Graph with Budget vs Consumption, you will not be able to use conditional formatting. You can use line and clustered column chart to achieve this goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First add values to the field like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a measure for conditional formatting :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),"Red","Green")&lt;/LI-CODE&gt;
&lt;P&gt;Apply it to the columns&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Turn on the Data labels:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If you want the part of the bar that below the budget line become green and the over part become red:&lt;BR /&gt;Please try:&lt;BR /&gt;Create these measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Below Budget = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),MAX('Table'[Budget]),MAX('Table'[Consumed]))

Over Budget = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),MAX('Table'[Consumed])-MAX('Table'[Budget]),0)&lt;/LI-CODE&gt;
&lt;P&gt;Then apply it to stacked bar chart:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Use these measure to create constant line:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Line A = MAXX(FILTER('Table',[Category]="A"),[Budget])

Line B = MAXX(FILTER('Table',[Category]="B"),[Budget])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;&amp;nbsp;&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 07:16:02 GMT</pubDate>
    <dc:creator>v-jianboli-msft</dc:creator>
    <dc:date>2022-07-27T07:16:02Z</dc:date>
    <item>
      <title>Data Visualization with Rule Based Color in Column Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657336#M78637</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a summarised Dataset where the Fields are like this.&lt;BR /&gt;Category -- Budget -- Consumed&amp;nbsp;&lt;/P&gt;&lt;P&gt;A -- 1000 -- 500&lt;/P&gt;&lt;P&gt;B -- 4000 -- 4500&lt;/P&gt;&lt;P&gt;Now I want to Generate a Bar Graph with Budget vs Consumption. I want my Consumption bars to become red when it will cross the Budget Field and it will remain Green when it is below the Budget line.&lt;BR /&gt;&lt;BR /&gt;Any DAX Formula or suggestion how to achieve this please?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 07:47:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657336#M78637</guid>
      <dc:creator>arafmustavi</dc:creator>
      <dc:date>2022-07-24T07:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Visualization with Rule Based Color in Column Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657345#M78641</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="400299" data-lia-user-login="arafmustavi" class="lia-mention lia-mention-user"&gt;arafmustavi&lt;/a&gt;&amp;nbsp;please find a link to a file with a solution:&lt;BR /&gt;&lt;A href="https://spartabiltd-my.sharepoint.com/:u:/g/personal/avishayf_spartabi_com/EcESfqtwe05IiAd7676JFH4B5rOaGuPzaYc1THx6wkNjXg?e=6obbc2" target="_blank"&gt;Data Visualization with Rule Based Color in Column Graph 2022-07-24.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;&lt;FONT size="4" color="#0000EE"&gt;Showcase Report – Contoso By SpartaBI&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 08:34:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657345#M78641</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-07-24T08:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Visualization with Rule Based Color in Column Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657348#M78642</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="400299" data-lia-user-login="arafmustavi" class="lia-mention lia-mention-user"&gt;arafmustavi&lt;/a&gt;&amp;nbsp;I created this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Color = 
SWITCH(
    TRUE(),
    SUM('Table'[Consumed]) &amp;gt; SUM('Table'[Budget]), "Red",
    "Green"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In the visual settings on the Bars colors I used the conditional formatting (Fx) option:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Then set it to this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;&lt;FONT size="4" color="#0000EE"&gt;Showcase Report – Contoso By SpartaBI&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 08:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2657348#M78642</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-07-24T08:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Visualization with Rule Based Color in Column Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2664014#M79082</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="400299" data-lia-user-login="arafmustavi" class="lia-mention lia-mention-user"&gt;arafmustavi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. IF you want the whole consumed bar to become green or red:&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp; mentioned before, you can use conditional formatting to change the color. However if you want to generate a Bar Graph with Budget vs Consumption, you will not be able to use conditional formatting. You can use line and clustered column chart to achieve this goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First add values to the field like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a measure for conditional formatting :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),"Red","Green")&lt;/LI-CODE&gt;
&lt;P&gt;Apply it to the columns&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Turn on the Data labels:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If you want the part of the bar that below the budget line become green and the over part become red:&lt;BR /&gt;Please try:&lt;BR /&gt;Create these measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Below Budget = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),MAX('Table'[Budget]),MAX('Table'[Consumed]))

Over Budget = IF(MAX('Table'[Consumed])&amp;gt;MAX('Table'[Budget]),MAX('Table'[Consumed])-MAX('Table'[Budget]),0)&lt;/LI-CODE&gt;
&lt;P&gt;Then apply it to stacked bar chart:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Use these measure to create constant line:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Line A = MAXX(FILTER('Table',[Category]="A"),[Budget])

Line B = MAXX(FILTER('Table',[Category]="B"),[Budget])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SUP&gt;&amp;nbsp;&lt;/SUP&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 07:16:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Visualization-with-Rule-Based-Color-in-Column-Graph/m-p/2664014#M79082</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-07-27T07:16:02Z</dc:date>
    </item>
  </channel>
</rss>

