<?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: Calculate function with Boolean filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1878160#M40311</link>
    <description>&lt;P&gt;There's no aggregation i.e. SUM, COUNT, AVERAGE in the first measure shown.&lt;/P&gt;
&lt;P&gt;The 2nd one will give results if the datatypes on the columns are correct and there's no spaces or case differences in the Gender column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 things to try:&lt;/P&gt;
&lt;P&gt;Can you post a small sample of data please (not a picture) and say what the desired outcome is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Maybe you could create a measure&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;AVERAGE(Countries[Population])&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and just test that on a card.&amp;nbsp; You could apply a filter from the filter pane (using Gender to test Male/Female) to further test.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 15:31:24 GMT</pubDate>
    <dc:creator>HotChilli</dc:creator>
    <dc:date>2021-06-02T15:31:24Z</dc:date>
    <item>
      <title>Calculate function with Boolean filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1877940#M40305</link>
      <description>&lt;P&gt;Good Afternoon,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hopefully someone can help me with the below.&lt;/P&gt;&lt;P&gt;I am trying to create the below measure but get a blank value when used with a card visual with no filter&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Gender Ratio =
var FemalePopulation = CALCULATE(Countries[Population], Countries[Gender] = "Female")
var MalePopulation = CALCULATE(Countries[Population], Countries[Gender] = "Male")

Return
DIVIDE(FemalePopulation, MalePopulation)&lt;/LI-CODE&gt;&lt;P&gt;As a test I tried the below which also returns blank&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;test = CALCULATE(AVERAGE(Countries[Population]), (Countries[Gender] = "Male"))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I then tried to use summarize but got a syntax error&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table =
SUMMARIZE(Countries,Countries[Country Code],Countries[Age Range],Countries[Year],
DIVIDE(
CALCULATE (Countries[Population], Countries[Gender] = "Female"),
CALCULATE(Countries[Population], Countries[Gender] = "Male"))
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 14:07:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1877940#M40305</guid>
      <dc:creator>TimAnymouse</dc:creator>
      <dc:date>2021-06-02T14:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate function with Boolean filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1878160#M40311</link>
      <description>&lt;P&gt;There's no aggregation i.e. SUM, COUNT, AVERAGE in the first measure shown.&lt;/P&gt;
&lt;P&gt;The 2nd one will give results if the datatypes on the columns are correct and there's no spaces or case differences in the Gender column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 things to try:&lt;/P&gt;
&lt;P&gt;Can you post a small sample of data please (not a picture) and say what the desired outcome is?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Maybe you could create a measure&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;AVERAGE(Countries[Population])&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and just test that on a card.&amp;nbsp; You could apply a filter from the filter pane (using Gender to test Male/Female) to further test.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 15:31:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1878160#M40311</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2021-06-02T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate function with Boolean filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1878432#M40315</link>
      <description>&lt;P&gt;Thanks, it was a leading space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 18:12:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-function-with-Boolean-filter/m-p/1878432#M40315</guid>
      <dc:creator>TimAnymouse</dc:creator>
      <dc:date>2021-06-02T18:12:36Z</dc:date>
    </item>
  </channel>
</rss>

