<?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: IF function help in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2896436#M94190</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please provide some &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;/FONT&gt; instead of the data after calculated on the visual? There is no customer info in the table... Base on your provided data, what's the correct result?&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;It is better&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;simplified&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;pbix file. You can refer the following link to upload the file to the community. And how do you judge the custom is active or inactive? Could you please share the related logic. Whether the sales on selected month is greater than 0, then active? Otherwise, inactive? Because according to the logic which you shared before, the displayed result is &lt;FONT color="#008000"&gt;&lt;STRONG&gt;correct &lt;/STRONG&gt;&lt;/FONT&gt;since the the sales for Previous 4 Months are all greater than 0.... Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 01:20:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-10T01:20:40Z</dc:date>
    <item>
      <title>IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893116#M93968</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help solving why my IF function is not working properly.&amp;nbsp; Power BI accepts the dax formula as correct, but it is not populating when I put it into a visual (Card or Table).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am looking to solve for is:&lt;/P&gt;&lt;P&gt;If a customer does not have any sales in the last 4 months, then the customer is considered "Inactive".&lt;/P&gt;&lt;P&gt;And the latter - If the customer does have sales in the last 4 months, then the customer would be considered "Active".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My previous 4 months dax formula looks like:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Previous 4 Months = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'VALUE ENTRY'&lt;/SPAN&gt;&lt;SPAN&gt;[Sales Amount (Actual)]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DATESINPERIOD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),-&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My IF function looks like:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:30:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893116#M93968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-08T17:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893122#M93970</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Inactive = IF([Previous 4 Months] &amp;lt; 0, "Inactive", "Active")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:32:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893122#M93970</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-08T17:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893153#M93974</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; Thanks for the response!&lt;/P&gt;&lt;P&gt;hmm, I updated the formula format to the same as your suggestion, but unfortunately it's still not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:45:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893153#M93974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-08T17:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893167#M93977</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Try something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous 4 Months =
  VAR __MaxDate = MAX('Calendar'[Date])
  VAR __MonthsAgo = EOMONTH(__MaxDate,-4)
  VAR __MinDate = DATE(YEAR(__MonthsAgo),MONTH(__MonthsAgo),DAY(__MaxDate))
  VAR __Table = FILTER('VALUE ENTRY', [Date] &amp;gt;= __MinDate &amp;amp;&amp;amp; [Date] &amp;lt;= __MaxDate)
  VAR __Result = SUMX(__Table, [Sales Amount (Actual)]
RETURN
  __Result&lt;/LI-CODE&gt;
&lt;P&gt;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:52:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2893167#M93977</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-11-08T17:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2894373#M94044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(see &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if that is what you want. You can create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below to get it:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Inactive = 
VAR _enddate =
    TODAY ()
VAR _sales =
    CALCULATE (
        SUM ( 'VALUE ENTRY'[Sales Amount (Actual)] ),
        FILTER (
            'VALUE ENTRY',
            'VALUE ENTRY'[Sales Date]
                &amp;gt; EOMONTH ( _enddate, -4 ) + 1
                &amp;amp;&amp;amp; 'VALUE ENTRY'[Sales Date] &amp;lt;= _enddate
        )
    )
RETURN
    IF ( _sales &amp;gt; 0, "Active", "Inactive" )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In addition,&amp;nbsp; you can refer the following thread to get it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Active-Customers-if-has-orders-in-last-X-months/td-p/1551502" target="_self"&gt;&lt;SPAN&gt;Active Customers if has orders in last X months&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your table&lt;STRONG&gt; 'VALUE ENTRY'&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;(&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples. By the way, the last 4 months means from the selected date to current date(today) or something else?&amp;nbsp;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C52042a9abdcb4f87992108da9226a782%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637982991998684943%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=UtrFZ3zCvCcIHUi%2FVD3ptir0IqV85%2BozKiH9HbdDJHc%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 05:47:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2894373#M94044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-09T05:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2895538#M94106</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sure thing!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to build this formula off of a data filter - ex below: 9/1/2021 thru 9/30/2022&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is a sample of my data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I was trying to build an IF statement off of my previous 4 months measure:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;IF measure:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But as you can see above, in September, it shows the customer as being 'active', instead of 'inactive'.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 17:28:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2895538#M94106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-09T17:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: IF function help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2896436#M94190</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please provide some &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;/FONT&gt; instead of the data after calculated on the visual? There is no customer info in the table... Base on your provided data, what's the correct result?&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;It is better&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;simplified&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;pbix file. You can refer the following link to upload the file to the community. And how do you judge the custom is active or inactive? Could you please share the related logic. Whether the sales on selected month is greater than 0, then active? Otherwise, inactive? Because according to the logic which you shared before, the displayed result is &lt;FONT color="#008000"&gt;&lt;STRONG&gt;correct &lt;/STRONG&gt;&lt;/FONT&gt;since the the sales for Previous 4 Months are all greater than 0.... Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 01:20:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-function-help/m-p/2896436#M94190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-10T01:20:40Z</dc:date>
    </item>
  </channel>
</rss>

