<?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: Quartile calculation based on filters applied on page in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3836090#M149984</link>
    <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Apr 2024 08:30:13 GMT</pubDate>
    <dc:creator>ThxAlot</dc:creator>
    <dc:date>2024-04-14T08:30:13Z</dc:date>
    <item>
      <title>Quartile calculation based on filters applied on page</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835322#M149959</link>
      <description>&lt;P&gt;Hello, I have a dataset that has Agents and their Metric scores for which I have to calculate Quartile. Q1 is the top quartile and Q4 is the bottom Quartile.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample :&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;But when I use the below function, it doesn't give the accurate Quartile. I am assuming it's because it's calculating the Quartile based on entire data set. I have multiple filters like Months, Dates, Department etc. So basically, my table should calculate the Quartile based on agents visible on table by applying all filters applicable on the visual.&amp;nbsp;&lt;/P&gt;&lt;P&gt;=&lt;BR /&gt;VAR AgentScore = [Customer Resolve %]&lt;BR /&gt;VAR FilteredData = ALL(Agent_mapping[Agent ID])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AgentScore &amp;lt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.25), "Q1",&lt;BR /&gt;IF(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AgentScore &amp;lt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.50), "Q2",&lt;BR /&gt;IF(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AgentScore &amp;lt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.75), "Q3", "Q4"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the forum for help, but couldn't find the help I need. Kindly help me with this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 07:58:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835322#M149959</guid>
      <dc:creator>Sri_phani</dc:creator>
      <dc:date>2024-04-13T07:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Quartile calculation based on filters applied on page</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835335#M149960</link>
      <description>&lt;P&gt;ALL function will not consider the filters within the visual and also the filters from other visuals. Based on what I understand, you should use ALLSELECTED instead of ALL. If you need any help further then I would request you to share the pbix with sample data and expected output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;If the post helps please give a thumbs up&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If it solves your issue, please accept it as the solution to help the other members find it more quickly.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Tharun&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 08:01:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835335#M149960</guid>
      <dc:creator>tharunkumarRTK</dc:creator>
      <dc:date>2024-04-13T08:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Quartile calculation based on filters applied on page</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835530#M149966</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="685422" data-lia-user-login="tharunkumarRTK" class="lia-mention lia-mention-user"&gt;tharunkumarRTK&lt;/a&gt;&amp;nbsp;thank you for responding. I already tried ALLSELECTED. But it is not working with multiple slicers. I am attaching the sample PBI file. It only has two slicers. just to let you know, my data has Team leader, Department, Month as slicers.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to create is, the Quartile should be calculated based on the agent scores available on Visuals based on the slicers we select.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1OdXEio6xP6912qy4b5EjRfhIDdlpvSo-/view?usp=sharing" target="_self"&gt;Sample PBIX file&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 12:52:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835530#M149966</guid>
      <dc:creator>Sri_phani</dc:creator>
      <dc:date>2024-04-13T12:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Quartile calculation based on filters applied on page</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835551#M149968</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="475653" data-lia-user-login="Sri_phani" class="lia-mention lia-mention-user"&gt;Sri_phani&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I think there is no issue with the filters, If my understanding about your requirement is right then your formula is incorrect&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Quartile = 

VAR AgentScore = [Customer Resolve %]
VAR FilteredData = ALLSELECTED(data[Agent ID])

return SWITCH(
    TRUE(),
    AgentScore &amp;gt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.75), "Q1", 
    AgentScore &amp;gt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.25), "Q2", 
    AgentScore &amp;gt;= PERCENTILEX.INC(FilteredData, [Customer Resolve %], 0.25), "Q3", 
    "Q4"
) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the pbix file:&lt;A href="https://drive.google.com/file/d/1v45qYd07R7ryenUMobsInrMl6Ji3bz7A/view?usp=share_link" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;If the post helps please give a thumbs up&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If it solves your issue, please accept it as the solution to help the other members find it more quickly.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Tharun&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Apr 2024 13:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3835551#M149968</guid>
      <dc:creator>tharunkumarRTK</dc:creator>
      <dc:date>2024-04-13T13:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Quartile calculation based on filters applied on page</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3836090#M149984</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2024 08:30:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quartile-calculation-based-on-filters-applied-on-page/m-p/3836090#M149984</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2024-04-14T08:30:13Z</dc:date>
    </item>
  </channel>
</rss>

