<?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 Threshold Analysis in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104829#M109348</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="521733" data-lia-user-login="DEMDEJ" class="lia-mention lia-mention-user"&gt;DEMDEJ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 - Transform your Month only column to a full date.&lt;/P&gt;&lt;P&gt;- Sep 2022 becomes 9/1/2022.&lt;/P&gt;&lt;P&gt;- Feb 2023 becomes 2/1/2023&lt;/P&gt;&lt;P&gt;This is easily done in Power Query Editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2 - Also in Power Query Editor, select all the month columns &amp;amp; unpivot them so that instead of a separate column for each month-year, you now only have 1 column for "Date" &amp;amp; 1 column for "Value" (or whatever you want to rename it).&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;&lt;P&gt;Step 3 - In the model, create the 1:* relationship between 'Date'[Date] &amp;amp; 'Data'[Date]&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;&lt;P&gt;Step 4 Create a new measure called _B4PrevMONTH &lt;STRONG&gt;V2&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;This resolves the issue of (2 - 2 = 0) the invalid month number.&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;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can upload a PBIX to Google Drive, make it public &amp;amp; then share the link here on forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should resolve the issue with your blank values for the "2 months ago" measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 22:35:34 GMT</pubDate>
    <dc:creator>WinterMist</dc:creator>
    <dc:date>2023-02-28T22:35:34Z</dc:date>
    <item>
      <title>Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104356#M109309</link>
      <description>&lt;P&gt;This is what I want to do:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have two issues that I have been stuck with:&lt;/P&gt;&lt;P&gt;1. When calculating my month fields, I can only go back to the previous month using this formula, else, it's blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;_PrevMONTH = var _CURRENTMONTH= MONTH(TODAY())&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; RETURN&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; CALCULATE(COUNT('Official'[nature]),FILTER('Official',MONTH([DATE])=_CURRENTMONTH -1))&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;-------------------------------&lt;/DIV&gt;&lt;DIV&gt;The formula below shows blanks for all values.&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;_B4PrevMONTH&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;= var _CURRENTMONTH= MONTH(TODAY())&lt;/STRONG&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; RETURN&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; CALCULATE(COUNT('Official'[nature]),FILTER('Official',MONTH([DATE])=_CURRENTMONTH -2))&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My goal is to create a measure for all calculations, but I'm open.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2. My second issue that I cannot sort the months from most recent to oldest instead of chronological (Feb, Jan, Dec, Nov, Oct)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I've created a calendar table and joined it will my table, created sort bys, and still can't find a way to make it work.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any assistance is greatly appreciated and I will give kudos!&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Feb 2023 17:14:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104356#M109309</guid>
      <dc:creator>DEMDEJ</dc:creator>
      <dc:date>2023-02-28T17:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104516#M109327</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="521733" data-lia-user-login="DEMDEJ" class="lia-mention lia-mention-user"&gt;DEMDEJ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure I completely understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Are the numbers in the rows of the month columns actual data?&amp;nbsp; Or are they calculations?&amp;nbsp; Do you have a test data set sample so that we could look at an isolated example of the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) If I understand correctly:&lt;/P&gt;&lt;P&gt;- The [_PrevMONTH] measure works no problem.&lt;/P&gt;&lt;P&gt;- The [_B4PrevMONTH] measure does NOT work, &amp;amp; returns only BLANKS.&lt;/P&gt;&lt;P&gt;Is it possible for you to include a screenshot of the visual where you are including this measure &amp;amp; getting blanks so we can get an idea of the filter context?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) How did you create your calendar table?&amp;nbsp; If by DAX, can you share the DAX used?&amp;nbsp; What is the start date &amp;amp; end date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: It will not be sufficient to only have month.&amp;nbsp; For example, if the current month is Feb (month #2) &amp;amp; you try to subtract 2, you'll get 0, which is not a valid month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:39:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104516#M109327</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2023-02-28T19:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104708#M109338</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340078" data-lia-user-login="WinterMist" class="lia-mention lia-mention-user"&gt;WinterMist&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. It's actual data aggregated for each month&lt;/P&gt;&lt;P&gt;2. I added a few things in the calendar by DAX, but imported most.&lt;/P&gt;&lt;P&gt;Feb #2 - 2 months = 0 totally makes sense! Can you help with the work around?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I upload the powerbi file?&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;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TYPE&lt;/TD&gt;&lt;TD&gt;DATE&lt;/TD&gt;&lt;TD&gt;MONTH&lt;/TD&gt;&lt;TD&gt;YEAR&lt;/TD&gt;&lt;TD&gt;DAY&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CASE2&lt;/TD&gt;&lt;TD&gt;2/20/2023&lt;/TD&gt;&lt;TD&gt;FEB&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;FRI&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CASE2&lt;/TD&gt;&lt;TD&gt;1/31/2023&lt;/TD&gt;&lt;TD&gt;JAN&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;MON&lt;/TD&gt;&lt;/TR&gt;&lt;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&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what the sample look like&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 21:11:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104708#M109338</guid>
      <dc:creator>DEMDEJ</dc:creator>
      <dc:date>2023-02-28T21:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104829#M109348</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="521733" data-lia-user-login="DEMDEJ" class="lia-mention lia-mention-user"&gt;DEMDEJ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1 - Transform your Month only column to a full date.&lt;/P&gt;&lt;P&gt;- Sep 2022 becomes 9/1/2022.&lt;/P&gt;&lt;P&gt;- Feb 2023 becomes 2/1/2023&lt;/P&gt;&lt;P&gt;This is easily done in Power Query Editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2 - Also in Power Query Editor, select all the month columns &amp;amp; unpivot them so that instead of a separate column for each month-year, you now only have 1 column for "Date" &amp;amp; 1 column for "Value" (or whatever you want to rename it).&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;&lt;P&gt;Step 3 - In the model, create the 1:* relationship between 'Date'[Date] &amp;amp; 'Data'[Date]&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;&lt;P&gt;Step 4 Create a new measure called _B4PrevMONTH &lt;STRONG&gt;V2&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;This resolves the issue of (2 - 2 = 0) the invalid month number.&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;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can upload a PBIX to Google Drive, make it public &amp;amp; then share the link here on forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should resolve the issue with your blank values for the "2 months ago" measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 22:35:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3104829#M109348</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2023-02-28T22:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3105272#M109373</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340078" data-lia-user-login="WinterMist" class="lia-mention lia-mention-user"&gt;WinterMist&lt;/a&gt;&amp;nbsp; Thanks so much for being such a great help! Do you mind sharing recommendations for becoming better at PowerBI?&lt;/P&gt;&lt;P&gt;You are AWESOME!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 05:18:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3105272#M109373</guid>
      <dc:creator>DEMDEJ</dc:creator>
      <dc:date>2023-03-01T05:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Threshold Analysis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3106039#M109457</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="521733" data-lia-user-login="DEMDEJ" class="lia-mention lia-mention-user"&gt;DEMDEJ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are welcome.&amp;nbsp; Thanks for the kind words.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For improving in DAX, check the following thread:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-learn-DAX-from-beginning-to-Advance/m-p/2586316#M74389" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-learn-DAX-from-beginning-to-Advance/m-p/2586316#M74389&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 14:24:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Threshold-Analysis/m-p/3106039#M109457</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2023-03-01T14:24:30Z</dc:date>
    </item>
  </channel>
</rss>

