<?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 Advanced IF function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2822711#M89643</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new in Power BI and I am trying to figure out how can I do my task. I need to write a dax (probably by function IF) where when day of the month is less or equal to 5, I need to add to my price&amp;nbsp; 4% costs, for these 5 days of new month and all previous month. But when day of the month passes 6 and more, I need add to the price 4% only for this new month. No more previous month.&lt;/P&gt;&lt;P&gt;Example: If now is second day of new month, I need + 4% to my price for this new month (2 days) and all days of previous month. If now is 6th day of the new month, I need + 4% to my price only for this month and no more for previous month.&amp;nbsp;&lt;BR /&gt;Can someone help me please?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is one of my many attempts, but this is not working properly.&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;Probably, because my condition "|| lastmonth" is everytime fullfiled.&lt;BR /&gt;Thanks for your advices&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 06 Oct 2022 12:27:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-06T12:27:51Z</dc:date>
    <item>
      <title>Advanced IF function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2822711#M89643</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new in Power BI and I am trying to figure out how can I do my task. I need to write a dax (probably by function IF) where when day of the month is less or equal to 5, I need to add to my price&amp;nbsp; 4% costs, for these 5 days of new month and all previous month. But when day of the month passes 6 and more, I need add to the price 4% only for this new month. No more previous month.&lt;/P&gt;&lt;P&gt;Example: If now is second day of new month, I need + 4% to my price for this new month (2 days) and all days of previous month. If now is 6th day of the new month, I need + 4% to my price only for this month and no more for previous month.&amp;nbsp;&lt;BR /&gt;Can someone help me please?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is one of my many attempts, but this is not working properly.&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;Probably, because my condition "|| lastmonth" is everytime fullfiled.&lt;BR /&gt;Thanks for your advices&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Oct 2022 12:27:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2822711#M89643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-06T12:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced IF function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2824509#M89764</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cost = SWITCH(
    TRUE(),
    MAXX(FILTER('Table','Table'[Month] = MONTH(TODAY())),'Table'[Day])&amp;lt;=5,[VNC+ Import]*1.04,
    'Table'[Month] = MONTH(TODAY()) &amp;amp;&amp;amp; MAXX(FILTER('Table','Table1'[Month] = MONTH(TODAY())),'Table'[Day])&amp;gt;6,[VNC+ Import]*1.04
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did test in two tables and both worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test table 1, until Oct 7th:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test table 2, until Oct 3rd:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Yadong Fang&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 04:37:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2824509#M89764</guid>
      <dc:creator>v-yadongf-msft</dc:creator>
      <dc:date>2022-10-07T04:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced IF function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2825351#M89814</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;unfortunately, it is not working for me and I do not know why. I tied exactly what you suggested, but no matter what, it is still multypling only this month and all data from previous months just disappear, which is not good. Even when I tied lower numbers of day, it still multiplied only this new month, never last month.&amp;nbsp;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 09:48:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2825351#M89814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-07T09:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced IF function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2825417#M89823</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's so strange!&lt;/P&gt;
&lt;P&gt;Can you share with me some sample data in table like this?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Yadong Fang&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 10:11:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Advanced-IF-function/m-p/2825417#M89823</guid>
      <dc:creator>v-yadongf-msft</dc:creator>
      <dc:date>2022-10-07T10:11:13Z</dc:date>
    </item>
  </channel>
</rss>

