<?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: Filter Conditions in swtich() function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4680206#M179264</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1268146" data-lia-user-login="jmcgowan-nz98" class="lia-mention lia-mention-user"&gt;jmcgowan-nz98&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.&lt;BR /&gt;If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
    <pubDate>Mon, 05 May 2025 11:45:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-05-05T11:45:29Z</dc:date>
    <item>
      <title>Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673608#M178986</link>
      <description>&lt;P&gt;I am creating a new column in one of my tables&lt;BR /&gt;&lt;BR /&gt;my dimension table has a one to many relationship with my fact table on a column called Machine ID&lt;BR /&gt;&lt;BR /&gt;What I am trying to do is compare the individual vehicle 75th percentile kilometre values with their respective group 75th percentile kilometre value&lt;BR /&gt;&lt;BR /&gt;Depending on the value of the group 75th percentile value and the individual 75th percentile value, the individual vehicle should be assigned to one of four categories:&lt;BR /&gt;* &amp;lt;= 100km&lt;BR /&gt;* &amp;gt; 100km and &amp;lt;= 150km&lt;BR /&gt;* &amp;gt; 150km and &amp;lt;= 200km&amp;nbsp;&lt;BR /&gt;&amp;gt; 200km&lt;BR /&gt;&lt;BR /&gt;my DAX runs without error, except it only categories the vehicles into the first category (&amp;lt;= 100km)&lt;BR /&gt;&lt;BR /&gt;The DAX that I am using to do this is here:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;DistanceCategory =&lt;BR /&gt;VAR VehicleType = SELECTEDVALUE('Dimension'[Vehicle Type])&lt;BR /&gt;VAR Vehicle = SELECTEDVALUE('Dimension'[Vehicle ID])&lt;/P&gt;&lt;P&gt;-- Group 75th percentile value&lt;BR /&gt;VAR GroupPercentile =&lt;BR /&gt;PERCENTILEX.INC(&lt;BR /&gt;FILTER(&lt;BR /&gt;FACT,&lt;BR /&gt;LOOKUPVALUE(&lt;BR /&gt;'Dimension'[Vehicle Type],&lt;BR /&gt;'Dimension'[Machine ID],&lt;BR /&gt;FACT[Machine ID]&lt;BR /&gt;) = VehicleType&lt;BR /&gt;),&lt;BR /&gt;FACT[Kilometres],&lt;BR /&gt;0.75 -- 75th percentile for the group&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- Individual vehicle 75th percentile value&lt;BR /&gt;VAR VehiclePercentile =&lt;BR /&gt;PERCENTILEX.INC(&lt;BR /&gt;FILTER(&lt;BR /&gt;FACT,&lt;BR /&gt;LOOKUPVALUE(&lt;BR /&gt;'Dimension'[Vehicle Type],&lt;BR /&gt;'Dimension'[Machine ID],&lt;BR /&gt;FACT[Machine ID]&lt;BR /&gt;) = VehicleType &amp;amp;&amp;amp;&lt;BR /&gt;LOOKUPVALUE(&lt;BR /&gt;'Dimension'[Vehicle ID],&lt;BR /&gt;'Dimension'[Machine ID],&lt;BR /&gt;FACT[Machine ID]&lt;BR /&gt;) = Vehicle&lt;BR /&gt;),&lt;BR /&gt;FACT[Kilometres],&lt;BR /&gt;0.75 -- 75th percentile for the individual vehicle&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- Categorize based on group and individual vehicle 75th percentile&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;GroupPercentile &amp;lt;= 100 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 100,&lt;BR /&gt;"&amp;lt;= 100km",&lt;BR /&gt;GroupPercentile &amp;gt; 100 &amp;amp;&amp;amp; GroupPercentile &amp;lt;= 150 &amp;amp;&amp;amp;&lt;BR /&gt;VehiclePercentile &amp;gt; 100 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 150,&lt;BR /&gt;"&amp;gt; 100km &amp;amp;&amp;amp; &amp;lt;= 150km",&lt;BR /&gt;GroupPercentile &amp;gt; 150 &amp;amp;&amp;amp; GroupPercentile &amp;lt;= 200 &amp;amp;&amp;amp;&lt;BR /&gt;VehiclePercentile &amp;gt; 150 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 200,&lt;BR /&gt;"&amp;gt; 150km &amp;amp;&amp;amp; &amp;lt;= 200km",&lt;BR /&gt;GroupPercentile &amp;gt; 200 &amp;amp;&amp;amp; VehiclePercentile &amp;gt; 200,&lt;BR /&gt;"&amp;gt; 200km",&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 23:38:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673608#M178986</guid>
      <dc:creator>jmcgowan-nz98</dc:creator>
      <dc:date>2025-04-29T23:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673615#M178987</link>
      <description>&lt;P&gt;If you are creating a calculated column then SELECTEDVALUE has no meaning. It can only be used for measures.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 23:46:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673615#M178987</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-04-29T23:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673617#M178988</link>
      <description>&lt;P&gt;what function can I then use to replace it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 23:48:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673617#M178988</guid>
      <dc:creator>jmcgowan-nz98</dc:creator>
      <dc:date>2025-04-29T23:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673631#M178990</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;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &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;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>Wed, 30 Apr 2025 00:20:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673631#M178990</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-04-30T00:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673644#M178992</link>
      <description>&lt;P&gt;try using related and treatas().&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DistanceCategory =&lt;BR /&gt;VAR MachineID = 'Dimension'[Machine ID]&lt;BR /&gt;VAR VehicleType = RELATED('Dimension'[Vehicle Type])&lt;BR /&gt;VAR VehicleID = RELATED('Dimension'[Vehicle ID])&lt;/P&gt;
&lt;P&gt;-- Group 75th percentile&lt;BR /&gt;VAR GroupPercentile =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;PERCENTILEX.INC(FACT, FACT[Kilometres], 0.75),&lt;BR /&gt;FACT,&lt;BR /&gt;TREATAS({VehicleType}, 'Dimension'[Vehicle Type])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;-- Individual vehicle 75th percentile&lt;BR /&gt;VAR VehiclePercentile =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;PERCENTILEX.INC(FACT, FACT[Kilometres], 0.75),&lt;BR /&gt;FACT,&lt;BR /&gt;TREATAS({VehicleID}, 'Dimension'[Vehicle ID])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;GroupPercentile &amp;lt;= 100 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 100,&lt;BR /&gt;"&amp;lt;= 100km",&lt;BR /&gt;GroupPercentile &amp;gt; 100 &amp;amp;&amp;amp; GroupPercentile &amp;lt;= 150 &amp;amp;&amp;amp;&lt;BR /&gt;VehiclePercentile &amp;gt; 100 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 150,&lt;BR /&gt;"&amp;gt; 100km &amp;amp;&amp;amp; &amp;lt;= 150km",&lt;BR /&gt;GroupPercentile &amp;gt; 150 &amp;amp;&amp;amp; GroupPercentile &amp;lt;= 200 &amp;amp;&amp;amp;&lt;BR /&gt;VehiclePercentile &amp;gt; 150 &amp;amp;&amp;amp; VehiclePercentile &amp;lt;= 200,&lt;BR /&gt;"&amp;gt; 150km &amp;amp;&amp;amp; &amp;lt;= 200km",&lt;BR /&gt;GroupPercentile &amp;gt; 200 &amp;amp;&amp;amp; VehiclePercentile &amp;gt; 200,&lt;BR /&gt;"&amp;gt; 200km",&lt;BR /&gt;"Unclassified"&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 00:37:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4673644#M178992</guid>
      <dc:creator>Shravan133</dc:creator>
      <dc:date>2025-04-30T00:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4680206#M179264</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1268146" data-lia-user-login="jmcgowan-nz98" class="lia-mention lia-mention-user"&gt;jmcgowan-nz98&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.&lt;BR /&gt;If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Mon, 05 May 2025 11:45:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4680206#M179264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-05T11:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4684818#M179431</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1268146" target="_blank"&gt;@jmcgowan-nz98&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.&lt;BR /&gt;If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 12:16:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4684818#M179431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-08T12:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4689100#M179577</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1268146" target="_blank" rel="noopener"&gt;@jmcgowan-nz98&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.&lt;BR /&gt;If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 11:24:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4689100#M179577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-12T11:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Conditions in swtich() function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4716256#M180645</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1268146" data-lia-user-login="jmcgowan-nz98" class="lia-mention lia-mention-user"&gt;jmcgowan-nz98&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As we haven't heard back from you, At this time we are closing this thread. If you have any further issues, please start a new thread in the community forum, and we are here to assist you. Thankyou for your understanding and continuous support.&lt;/P&gt;
&lt;P&gt;Thank you for being part of the Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Vinay Pabbu&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 07:01:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Conditions-in-swtich-function/m-p/4716256#M180645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-02T07:01:45Z</dc:date>
    </item>
  </channel>
</rss>

