<?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 Filter contex problem in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-contex-problem/m-p/3477417#M132879</link>
    <description>&lt;P&gt;Hi, I have a measure that calculates the average expense per month per selected period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to avoid being filtered by other time slicers on the page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have a bar chart with the X showing expense categories, Y showing the amount and as input value:&lt;/P&gt;&lt;P&gt;1. the total expense for the selected period according to the slicer (here I will select a specific year and specific month)&lt;/P&gt;&lt;P&gt;2. My measure returning what is the average expense per month for the selected period (here I want to return the average expense per month for the select year)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that I have explained myself. Currently, if I add both measures to the graph I am getting the same values because my measure is calculating the average of the selected month which ofc is the same as the total of the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below the code of my measure and an image to explain my goal:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;WA Monthly = 
VAR AnnualAmount =
    CALCULATE(
        [Net Amount TOT],
        ALL(
            DateTable[Date])
    )
VAR MonthlyTable =
    ADDCOLUMNS(
        SUMMARIZE(
            Merged_Final,
            DateTable[Year],DateTable[Month]
        ),
        "MonthlySales",[Net Amount TOT],
        "Wt",[Net Amount TOT]/AnnualAmount
    )
VAR WA_Monthly =
    SUMX(
        MonthlyTable,
        [Wt]*[MonthlySales]
    )
RETURN
ABS(WA_Monthly)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Oct 2023 16:41:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-15T16:41:55Z</dc:date>
    <item>
      <title>Filter contex problem</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-contex-problem/m-p/3477417#M132879</link>
      <description>&lt;P&gt;Hi, I have a measure that calculates the average expense per month per selected period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to avoid being filtered by other time slicers on the page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have a bar chart with the X showing expense categories, Y showing the amount and as input value:&lt;/P&gt;&lt;P&gt;1. the total expense for the selected period according to the slicer (here I will select a specific year and specific month)&lt;/P&gt;&lt;P&gt;2. My measure returning what is the average expense per month for the selected period (here I want to return the average expense per month for the select year)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that I have explained myself. Currently, if I add both measures to the graph I am getting the same values because my measure is calculating the average of the selected month which ofc is the same as the total of the month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;below the code of my measure and an image to explain my goal:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;WA Monthly = 
VAR AnnualAmount =
    CALCULATE(
        [Net Amount TOT],
        ALL(
            DateTable[Date])
    )
VAR MonthlyTable =
    ADDCOLUMNS(
        SUMMARIZE(
            Merged_Final,
            DateTable[Year],DateTable[Month]
        ),
        "MonthlySales",[Net Amount TOT],
        "Wt",[Net Amount TOT]/AnnualAmount
    )
VAR WA_Monthly =
    SUMX(
        MonthlyTable,
        [Wt]*[MonthlySales]
    )
RETURN
ABS(WA_Monthly)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2023 16:41:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-contex-problem/m-p/3477417#M132879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-15T16:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter contex problem</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-contex-problem/m-p/3479906#M133005</link>
      <description>&lt;P&gt;Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that 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;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &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>Tue, 17 Oct 2023 00:21:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-contex-problem/m-p/3479906#M133005</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-10-17T00:21:26Z</dc:date>
    </item>
  </channel>
</rss>

