<?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: Switch Formula with multiples condition based off existing measures and a column i have created. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3466351#M132302</link>
    <description>&lt;P&gt;Thank you for taking the time to respond.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Apologies, It seems I have made a typo, it should have read that the tolerance should be +/-10% or 500,000 for Qtr1 or if its Qtr 2 then it should be +/-10% or 250,000.&lt;BR /&gt;&lt;BR /&gt;so the checks that need to be done are first look at FY column (i added to dataset as a column so its not part of original dataset)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;determine what Q it is,&lt;BR /&gt;&lt;BR /&gt;if its Q1 then tolerance is +/-10% diff from previous Q or 500,000.&lt;BR /&gt;if its Q2 then tolerance is&amp;nbsp; +/-10% diff from previous Q or 250,000, i hope that makes sense.&amp;nbsp; so i need tio incorporate these additional criteria of dtermining the FYQ and applying 500,000 tolerance for Q1 or 250,000 tolerance f its Q2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 07:58:13 GMT</pubDate>
    <dc:creator>forgetmenot</dc:creator>
    <dc:date>2023-10-09T07:58:13Z</dc:date>
    <item>
      <title>Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3465800#M132254</link>
      <description>&lt;P&gt;I am a newbie and am really struggling with getting the logic right to create a Switch Formula.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have been asked to provide the following:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If Variance is within Qtr1 FY (April to Jun) then tolerance should be within +/-10%&amp;nbsp; or 500,000 whichever is less, or if it is in Qtr 2 FY (july-sep) then again i need to check whether its within&amp;nbsp;+/-10%&amp;nbsp; or 500,000.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My dataset only had a month field,&amp;nbsp; I created a calender table to work out FYQ, however im not sure how to reference this now in a switch formula to satisfy the above conditions and return either "in tolerance" or "outside tolerance".&lt;BR /&gt;&lt;BR /&gt;Can someone please assist?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So far i have:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Switch Q1 = &lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;RUE&lt;/SPAN&gt; &lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH_%_DIFF]&amp;gt;[&lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;1_HIGH] |&lt;/SPAN&gt;&lt;SPAN&gt;|[M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH_%_DIFF]&amp;lt;[&lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;2_LO],&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Y&lt;/SPAN&gt;&lt;SPAN&gt;es"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"No&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Im not sure how to add in a further condition to &lt;/SPAN&gt;&lt;SPAN&gt;check what the financial quarter is and the appropriate tolerance i.e 250,000 or 500,000&lt;BR /&gt;&lt;BR /&gt;Any help you provide woudl be much apprecaited.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 08 Oct 2023 19:02:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3465800#M132254</guid>
      <dc:creator>forgetmenot</dc:creator>
      <dc:date>2023-10-08T19:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3465814#M132256</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="562766" data-lia-user-login="forgetmenot" class="lia-mention lia-mention-user"&gt;forgetmenot&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;try below&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;Switch Q1 =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;RUE&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH_%_DIFF]&amp;lt;=[&lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;1_HIGH] |&lt;/SPAN&gt;&lt;SPAN&gt;|[M&lt;/SPAN&gt;&lt;SPAN&gt;ONTH_%_DIFF]&amp;gt;=[&lt;/SPAN&gt;&lt;SPAN&gt;T&lt;/SPAN&gt;&lt;SPAN&gt;2_LO]||[MONTH_%_DIFF]&amp;lt;500000,&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Y&lt;/SPAN&gt;&lt;SPAN&gt;es"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"No&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Did i answer your question? Mark my post as a solution which help other people to find&amp;nbsp; fast and easily.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 08 Oct 2023 19:27:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3465814#M132256</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-10-08T19:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3466351#M132302</link>
      <description>&lt;P&gt;Thank you for taking the time to respond.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Apologies, It seems I have made a typo, it should have read that the tolerance should be +/-10% or 500,000 for Qtr1 or if its Qtr 2 then it should be +/-10% or 250,000.&lt;BR /&gt;&lt;BR /&gt;so the checks that need to be done are first look at FY column (i added to dataset as a column so its not part of original dataset)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;determine what Q it is,&lt;BR /&gt;&lt;BR /&gt;if its Q1 then tolerance is +/-10% diff from previous Q or 500,000.&lt;BR /&gt;if its Q2 then tolerance is&amp;nbsp; +/-10% diff from previous Q or 250,000, i hope that makes sense.&amp;nbsp; so i need tio incorporate these additional criteria of dtermining the FYQ and applying 500,000 tolerance for Q1 or 250,000 tolerance f its Q2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 07:58:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3466351#M132302</guid>
      <dc:creator>forgetmenot</dc:creator>
      <dc:date>2023-10-09T07:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3467375#M132350</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="562766" data-lia-user-login="forgetmenot" class="lia-mention lia-mention-user"&gt;forgetmenot&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;provide sample data&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 18:06:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3467375#M132350</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-10-09T18:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474169#M132698</link>
      <description>&lt;P&gt;Sample data as canot provide original dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have used dax to calculate % difference between months. Calender table is set up to give me info like what FQ i am in.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can someone please assist how to carry out check what the FQ is and apply relevant tolerance&lt;/P&gt;&lt;P&gt;Tolerance is&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;+/-10% diff from previous Q or 500,000 (for Q1 and Q2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and % diff tolerance is&amp;nbsp; +/-10% diff from previous Q or 250,000 (For Q3 ad Q4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 19:25:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474169#M132698</guid>
      <dc:creator>forgetmenot</dc:creator>
      <dc:date>2023-10-12T19:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474178#M132699</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 19:32:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474178#M132699</guid>
      <dc:creator>forgetmenot</dc:creator>
      <dc:date>2023-10-12T19:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474287#M132705</link>
      <description>&lt;P&gt;To implement the logic you described with a switch formula based on financial quarters and tolerance levels, you can use the `SWITCH` function along with additional `IF` statements to check the financial quarter and apply the appropriate tolerance criteria. Here's a DAX formula that accomplishes this:&lt;/P&gt;&lt;P&gt;```DAX&lt;BR /&gt;Result =&lt;BR /&gt;VAR CurrentQuarter = SELECTEDVALUE(Calendar[FYQ])&lt;BR /&gt;VAR Variance = [MONTH_%_DIFF]&lt;BR /&gt;VAR ToleranceLevel =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;CurrentQuarter = "Q1 FY" &amp;amp;&amp;amp; (Variance &amp;gt; 0.1 || Variance &amp;lt; -0.1), 500000,&lt;BR /&gt;CurrentQuarter = "Q2 FY" &amp;amp;&amp;amp; (Variance &amp;gt; 0.1 || Variance &amp;lt; -0.1), 500000,&lt;BR /&gt;TRUE(), 100000&lt;BR /&gt;)&lt;BR /&gt;VAR WithinTolerance =&lt;BR /&gt;IF(&lt;BR /&gt;ABS(Variance) &amp;lt;= ToleranceLevel,&lt;BR /&gt;"In Tolerance",&lt;BR /&gt;"Outside Tolerance"&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;WithinTolerance&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Here's how this formula works:&lt;/P&gt;&lt;P&gt;1. `CurrentQuarter` calculates the financial quarter based on your calendar table.&lt;/P&gt;&lt;P&gt;2. `Variance` represents the percentage difference that you have.&lt;/P&gt;&lt;P&gt;3. `ToleranceLevel` calculates the tolerance level based on the financial quarter and whether the variance exceeds 10%. If it's Q1 or Q2 and the variance exceeds 10%, the tolerance is 500,000. Otherwise, it's 100,000.&lt;/P&gt;&lt;P&gt;4. `WithinTolerance` checks whether the absolute value of the variance is within the calculated tolerance level and returns "In Tolerance" or "Outside Tolerance" accordingly.&lt;/P&gt;&lt;P&gt;5. The `Result` measure returns the result of the `WithinTolerance` calculation.&lt;/P&gt;&lt;P&gt;This formula considers the financial quarter, percentage variance, and appropriate tolerance level, and then returns "In Tolerance" or "Outside Tolerance" based on these conditions. Adjust the tolerance levels and conditions as needed to match your specific requirements.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 20:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3474287#M132705</guid>
      <dc:creator>Alef_Ricardo_</dc:creator>
      <dc:date>2023-10-12T20:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Switch Formula with multiples condition based off existing measures and a column i have created.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3475133#M132739</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="603504" data-lia-user-login="Alef_Ricardo_" class="lia-mention lia-mention-user"&gt;Alef_Ricardo_&lt;/a&gt;&amp;nbsp;, Many thanks for your help and also apprecaite the thorough explanation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried your dax and its working now!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2023 18:21:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Switch-Formula-with-multiples-condition-based-off-existing/m-p/3475133#M132739</guid>
      <dc:creator>forgetmenot</dc:creator>
      <dc:date>2023-10-15T18:21:25Z</dc:date>
    </item>
  </channel>
</rss>

