<?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: Measure for colouring columns on a higher aggregation level than detailed data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3827975#M149673</link>
    <description>&lt;P&gt;Hi john basha33,&lt;BR /&gt;thank you very much fpr your input, but the returned value matches the value from this measure below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ØContractsMonthly =&lt;BR /&gt;var tbl = ADDCOLUMNS( VALUES( calendar[YYYYMM] ), "Contracts", [# Contracts]&lt;BR /&gt;return AVERAGEX( tbl, [# Contracts])&lt;BR /&gt;Your solutino (as mine) returns the Average valid for all periods selected&lt;/P&gt;&lt;P&gt;That seems fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is not answered yet..., why is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MyColumnColor =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var check = [MyMeasure]&amp;nbsp; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var limit = [MyMonthlyAverage] (&amp;lt;= [MyMonthlyNumberOfContracts] &amp;lt;= [ØContractsMonthly])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return SWITCH( TRUE(), check &amp;lt; limit, "Red", "Green")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... alwyays returns green color as result for all columns although the bar height is obviously below or above reference line composed of limit-value....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestoins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx &amp;amp; brgds&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 16:00:59 GMT</pubDate>
    <dc:creator>thomasreick</dc:creator>
    <dc:date>2024-04-10T16:00:59Z</dc:date>
    <item>
      <title>Measure for colouring columns on a higher aggregation level than detailed data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3826780#M149618</link>
      <description>&lt;P&gt;Hi there I kindly request your help/hints on the follwing, because I am stuck somwhere in between...&lt;BR /&gt;I need to color a column chart based on the average out of X Months, whereas No of months is from a relative date slicer&lt;/P&gt;&lt;P&gt;The data are weekly based (Date of Sunday) and is counting number of contracts:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MyMeasure = Sum( MyTable[NoOfContracts] )&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Using my datetable I am visualising MyMeasure in a columnchart&lt;BR /&gt;I wrote a measure to get the average per No of selected Months:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MyMonthlyAverage = AVERAGEX ( VALUES( calendar[MonthYear]), MyMeasure )&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Based on the relation between MyMeasure and MyMonthlyAverage I want to decide the color of the column, "Geen" for above, "Red" for below MyMonthlyAverage.&lt;BR /&gt;Unfortunateley it seems that the number per Month (MyMeasure) is not divided by no of months but by the number of Sunday-dates in the selected period (e.g. MyMonthlyNoOfContracts / No of Sunday-Dates (52) and not MyMonthlyNoOfContracts / No of Months selected (12))&lt;BR /&gt;&lt;BR /&gt;MyColumnColor =&lt;/P&gt;&lt;P&gt;var check = [MyMeasure]&lt;BR /&gt;var limit = [MyMonthlyAverage]&lt;BR /&gt;return SWITCH( TRUE(), check &amp;lt; limit, "Red", "Green")&lt;/P&gt;&lt;P&gt;Aways "Green" gets returned and so are the columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question: What is the Syntax to write a correct and proper MyMonthlyNumberOfContracts?&lt;/P&gt;&lt;P&gt;Appreciating your Input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx in advance&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 10:16:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3826780#M149618</guid>
      <dc:creator>thomasreick</dc:creator>
      <dc:date>2024-04-10T10:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for colouring columns on a higher aggregation level than detailed data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3826875#M149620</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305272" data-lia-user-login="thomasreick" class="lia-mention lia-mention-user"&gt;thomasreick&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To calculate the monthly average of the number of contracts correctly, you need to ensure that the calculation is based on the number of months selected in your slicer, rather than the number of Sunday-dates in the selected period. You can achieve this by modifying your measure to consider the number of months selected.&lt;/P&gt;&lt;P&gt;Here's how you can modify your measure to calculate the correct monthly average of the number of contracts:&lt;BR /&gt;&lt;BR /&gt;MyMonthlyNumberOfContracts =&lt;BR /&gt;VAR SelectedMonths = CALCULATE( COUNTROWS( VALUES( Calendar[MonthYear] ) ) )&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE( [MyMeasure], SelectedMonths, 0 )&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 10:56:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3826875#M149620</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2024-04-10T10:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for colouring columns on a higher aggregation level than detailed data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3827975#M149673</link>
      <description>&lt;P&gt;Hi john basha33,&lt;BR /&gt;thank you very much fpr your input, but the returned value matches the value from this measure below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ØContractsMonthly =&lt;BR /&gt;var tbl = ADDCOLUMNS( VALUES( calendar[YYYYMM] ), "Contracts", [# Contracts]&lt;BR /&gt;return AVERAGEX( tbl, [# Contracts])&lt;BR /&gt;Your solutino (as mine) returns the Average valid for all periods selected&lt;/P&gt;&lt;P&gt;That seems fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is not answered yet..., why is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MyColumnColor =&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var check = [MyMeasure]&amp;nbsp; &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var limit = [MyMonthlyAverage] (&amp;lt;= [MyMonthlyNumberOfContracts] &amp;lt;= [ØContractsMonthly])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return SWITCH( TRUE(), check &amp;lt; limit, "Red", "Green")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... alwyays returns green color as result for all columns although the bar height is obviously below or above reference line composed of limit-value....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestoins?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx &amp;amp; brgds&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 16:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-colouring-columns-on-a-higher-aggregation-level-than/m-p/3827975#M149673</guid>
      <dc:creator>thomasreick</dc:creator>
      <dc:date>2024-04-10T16:00:59Z</dc:date>
    </item>
  </channel>
</rss>

