<?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: Colouring measure not working properly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3836124#M149985</link>
    <description>&lt;P&gt;I have found the solution with a litle help frmo my friend ChatGPT....&lt;/P&gt;&lt;P&gt;TotalAverage=&lt;/P&gt;&lt;P&gt;VAR TotalSum = CALCULATE(SUM(facttable[countablevalue]), ALLSELECTED(calendar))&lt;BR /&gt;VAR TotalPeriods = CALCULATE(DISTINCTCOUNT(calendar[YYYYMM]), ALLSELECTED(calendar))&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalPeriods &amp;gt; 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSum / TotalPeriods ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BLANK()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not paid attention to filtercontext.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for readng and input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
    <pubDate>Sun, 14 Apr 2024 09:53:53 GMT</pubDate>
    <dc:creator>thomasreick</dc:creator>
    <dc:date>2024-04-14T09:53:53Z</dc:date>
    <item>
      <title>Colouring measure not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3832738#M149872</link>
      <description>&lt;P&gt;This is related to &lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3827975#M149673" target="_self"&gt;my last question &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want use a measure comparing against monthly figures.&lt;/P&gt;&lt;P&gt;The number of months is coming from a slicer.&lt;/P&gt;&lt;P&gt;The used measures are....&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;[# Contracts] = COUNTROWS(tblFacts)&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;[ØContractsMonthly] =&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var tbl = ADDCOLUMNS( VALUES( calendar[YYYYMM] ), "Contracts", [# Contracts]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return AVERAGEX( tbl, [# Contracts])&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;[ColumnColorContracs]=&lt;BR /&gt;&amp;nbsp;var check = [# Contracts]&lt;BR /&gt;var limit = [ØContractsMonthly]&lt;BR /&gt;return SWITCH( TRUE(), check &amp;gt;= limit, "Green", "Red" )&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;[# Contracts] is used as Value for Y-Axis, calendar[YYYYMM] is on X-Axis, Reference Line is using [&lt;EM&gt;ØContractsMonthly&lt;/EM&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have figured out the following:&lt;/P&gt;&lt;P&gt;Using a constant value&amp;nbsp;(e.g. 1500) instead of &lt;EM&gt;[ØContractsMonthly]&lt;/EM&gt; makes colouring work correctly.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;How can this be?&lt;/LI&gt;&lt;LI&gt;How to make it dynamically?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or hint or support is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 06:28:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3832738#M149872</guid>
      <dc:creator>thomasreick</dc:creator>
      <dc:date>2024-04-12T06:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring measure not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3834930#M149954</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 00:41:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3834930#M149954</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-13T00:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Colouring measure not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3836124#M149985</link>
      <description>&lt;P&gt;I have found the solution with a litle help frmo my friend ChatGPT....&lt;/P&gt;&lt;P&gt;TotalAverage=&lt;/P&gt;&lt;P&gt;VAR TotalSum = CALCULATE(SUM(facttable[countablevalue]), ALLSELECTED(calendar))&lt;BR /&gt;VAR TotalPeriods = CALCULATE(DISTINCTCOUNT(calendar[YYYYMM]), ALLSELECTED(calendar))&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalPeriods &amp;gt; 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSum / TotalPeriods ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BLANK()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not paid attention to filtercontext.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for readng and input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2024 09:53:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Colouring-measure-not-working-properly/m-p/3836124#M149985</guid>
      <dc:creator>thomasreick</dc:creator>
      <dc:date>2024-04-14T09:53:53Z</dc:date>
    </item>
  </channel>
</rss>

