<?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: Iterating over rows based on filter to write multiple if else statement and perform calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664084#M79093</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;for your quick response and solution. You helped me solve this issue.Thanks so much for your time.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2022 07:50:52 GMT</pubDate>
    <dc:creator>ASI80486</dc:creator>
    <dc:date>2022-07-27T07:50:52Z</dc:date>
    <item>
      <title>Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2662771#M79020</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the above table:&lt;/P&gt;&lt;P&gt;1. Need to&amp;nbsp;FILTER&amp;nbsp; by ([Month Name not equal]="Y"&amp;nbsp; and based on Asset Number) , since there are many other assets and this has to be done for each asset,&amp;nbsp;([Month Name not equal]="Y" will filter be Feb March April&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I need to write conditions and then update the next value for New DT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF[New DT] &amp;gt;= [Hrs Bw St and End Date] then [Hrs Bw St and End Date] else &amp;nbsp;[New DT] &lt;STRONG&gt;(1779.55&amp;gt;=520.04)&amp;nbsp; result of new column 520.04&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Update [New DT for next month(March)= [New DT]- [Hrs Bw St and End Date] New DT &lt;STRONG&gt;(March)--&amp;gt;1259.51&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF[New DT] &amp;gt;= [Hrs Bw St and End Date] then [Hrs Bw St and End Date] else &amp;nbsp;[New DT] (&lt;STRONG&gt;1259.51&amp;gt;=744)&amp;nbsp; result of new column 744&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;[New DT for next month(April) = [New DT] - [Hrs Bw St and End Date] &lt;STRONG&gt;(April)--&amp;gt; 515.51&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;IF[New DT] &amp;gt;= [Hrs Bw St and End Date] then [Hrs Bw St and End Date] else &amp;nbsp;[New DT] &lt;STRONG&gt;(515.51&amp;lt;=516.5) result of new colum 515.51&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;New column for DT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb&lt;/TD&gt;&lt;TD&gt;520.04&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;March&lt;/TD&gt;&lt;TD&gt;744&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;April&lt;/TD&gt;&lt;TD&gt;515.51&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help please??&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 17:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2662771#M79020</guid>
      <dc:creator>ASI80486</dc:creator>
      <dc:date>2022-07-26T17:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663347#M79045</link>
      <description>&lt;P&gt;In Power Query, go to Add Column &amp;gt; Add conditional column. There you'll have a user interface that produces a series of if (else) statements. Start from there, and if you can't do exactly what you want from the UI, you can always tweak the generated code manually from the Advanced Editor.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 22:38:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663347#M79045</guid>
      <dc:creator>otravers</dc:creator>
      <dc:date>2022-07-26T22:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663399#M79047</link>
      <description>&lt;P&gt;&lt;SPAN&gt;here the issue is to update the New DT column with new value and then use that updated new DT value in the next IF statement to calculate the next value in the new column&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 23:27:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663399#M79047</guid>
      <dc:creator>ASI80486</dc:creator>
      <dc:date>2022-07-26T23:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663419#M79053</link>
      <description>&lt;P&gt;Oh, I see, it's on a row-by-row basis. I don't think there's a solution using purely the Power Query UI, I think you'd have to add an index column and write some M code. It's probably something I'd solve in DAX though. Sorry I don't have time to flesh it out further, maybe other people will chime in.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 23:56:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2663419#M79053</guid>
      <dc:creator>otravers</dc:creator>
      <dc:date>2022-07-26T23:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664062#M79087</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417505" data-lia-user-login="ASI80486" class="lia-mention lia-mention-user"&gt;ASI80486&lt;/a&gt;&amp;nbsp;create this calculated column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Final Column = 
VAR _asset = 'asset_downtime (3)'[Asset Number]
VAR _time = 'asset_downtime (3)'[Start Date]
VAR _total = SUMX(FILTER('asset_downtime (3)', 'asset_downtime (3)'[Asset Number] = _asset &amp;amp;&amp;amp; 'asset_downtime (3)'[Month Name not equal] = "Y"),'asset_downtime (3)'[New DT]) 
VAR _substract =
    SUMX(
        FILTER(
            'asset_downtime (3)',
            'asset_downtime (3)'[Asset Number] = _asset 
                &amp;amp;&amp;amp; 'asset_downtime (3)'[Month Name not equal] = "Y" 
                    &amp;amp;&amp;amp; 'asset_downtime (3)'[Start Date] &amp;lt; _time
        ),
        'asset_downtime (3)'[Hrs Bw St and End Date]
    )
VAR _result = 
    SWITCH(
        TRUE(),
        'asset_downtime (3)'[Month Name not equal] = "N", 'asset_downtime (3)'[New DT],
        'asset_downtime (3)'[Hrs Bw St and End Date] &amp;lt;= 'asset_downtime (3)'[New DT], 'asset_downtime (3)'[Hrs Bw St and End Date],
        _total - _substract &amp;gt; 'asset_downtime (3)'[Hrs Bw St and End Date], 'asset_downtime (3)'[Hrs Bw St and End Date],
        _total - _substract
    )
RETURN
    MAX(_result, 0 )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;&lt;FONT size="4" color="#0000EE"&gt;Showcase Report – Contoso By SpartaBI&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 07:39:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664062#M79087</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-07-27T07:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664084#M79093</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;for your quick response and solution. You helped me solve this issue.Thanks so much for your time.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 07:50:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664084#M79093</guid>
      <dc:creator>ASI80486</dc:creator>
      <dc:date>2022-07-27T07:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating over rows based on filter to write multiple if else statement and perform calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664186#M79099</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="417505" data-lia-user-login="ASI80486" class="lia-mention lia-mention-user"&gt;ASI80486&lt;/a&gt;&amp;nbsp;my pleasure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 08:13:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Iterating-over-rows-based-on-filter-to-write-multiple-if-else/m-p/2664186#M79099</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-07-27T08:13:31Z</dc:date>
    </item>
  </channel>
</rss>

