<?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: Using IFs in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2948593#M97642</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to go through the code, but I feel that solution is more complicated than the required since all the tables are connected through the Date in the DimDates table. The sample Data model would be more like this:&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;And we want the ActualPL from the FactNAV Budget, I am so sorry for the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please revise these and help me adapt the code above?&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2022 13:49:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-05T13:49:08Z</dc:date>
    <item>
      <title>Using IFs in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2942801#M97257</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to PBI and I am struggling to get some DAX measures right, and I believe my problem is in understanding the IF function. And maybe using Calculate correctly to filter the information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea is to get a table like this and add two more columns with the Confirmed Revenue and the Revenue Total, that follow the bellow structure (the highlighted is the database name and after it is the field used):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using this FactTable in order to get the information, since I created a Type column to identify from which database the information came from:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Dates FactTable used and the Posted table structure is shown bellow:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;(the Posted table has the first day of the month as date, but it is irrelevant since we will use the month to group)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me write the two DAX measures for Confirmed Revenue and Revenue Total?&lt;BR /&gt;Help is much apreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 20:14:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2942801#M97257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-01T20:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using IFs in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2943771#M97313</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;You can try this method:&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;New measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CONFIRMED REVENUE = 
VAR _Staff =
    CALCULATE (
        SUM ( 'Fact Staffing forecast'[Revenue DKK] ),
        FILTER (
            'Fact Staffing forecast',
            'Fact Staffing forecast'[Date].[Month] = SELECTEDVALUE ( 'DimDates'[Month] )
        )
    )
VAR _actual =
    CALCULATE (
        SUM ( 'Fact NAV actual month'[Revenue DKK] ),
        FILTER (
            'Fact NAV actual month',
            'Fact NAV actual month'[Date].[Month] = SELECTEDVALUE ( 'DimDates'[Month] )
        )
    )
RETURN
    IF (
        SELECTEDVALUE ( 'DimDates'[Post] ) = "Yes",
        0,
        IF (
            MAX ( 'DimDates'[Month Number] ) = MONTH ( TODAY () ),
            _actual + _Staff,
            _Staff
        )
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;REVENUE TOTAL =
VAR _budget =
    CALCULATE (
        SUM ( 'Fact NAV budget'[Revenue DKK] ),
        FILTER (
            'Fact NAV budget',
            'Fact NAV budget'[Date].[Month] = SELECTEDVALUE ( 'DimDates'[Month] )
        )
    )
RETURN
    IF ( SELECTEDVALUE ( 'DimDates'[Post] ) = "Yes", _budget, [CONFIRMED REVENUE] )
&lt;/LI-CODE&gt;
&lt;P&gt;The result is:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps you.&lt;/P&gt;
&lt;P&gt;Here is my PBIX file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Yinliw&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 07:15:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2943771#M97313</guid>
      <dc:creator>v-yinliw-msft</dc:creator>
      <dc:date>2022-12-02T07:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using IFs in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2948593#M97642</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to go through the code, but I feel that solution is more complicated than the required since all the tables are connected through the Date in the DimDates table. The sample Data model would be more like this:&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;And we want the ActualPL from the FactNAV Budget, I am so sorry for the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please revise these and help me adapt the code above?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 13:49:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-IFs-in-DAX/m-p/2948593#M97642</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-05T13:49:08Z</dc:date>
    </item>
  </channel>
</rss>

