<?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: Calculated Column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673384#M79799</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198866" data-lia-user-login="bob57" class="lia-mention lia-mention-user"&gt;bob57&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is a sample file with the solution&amp;nbsp;&lt;A href="https://we.tl/t-KWLD6ZeAMf" target="_blank"&gt;https://we.tl/t-KWLD6ZeAMf&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Difference = 
VAR CurrentBase = Data[Base]
VAR CurrentRating = Data[Rating]
VAR CurrentMatchYesRating = CALCULATE ( MAX ( Data[Rating] ), ALLEXCEPT ( Data, Data[Match] ), Data[Base] = "yes" )
VAR Result =
    IF (
        CurrentBase = "no",
        CurrentRating - CurrentMatchYesRating,
        0
    )
RETURN
    ROUNDDOWN ( Result, 0 )&lt;/LI-CODE&gt;&lt;P&gt;You may need to readjust the rounding type as per your requirement.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 15:26:43 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-08-01T15:26:43Z</dc:date>
    <item>
      <title>Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673261#M79788</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm hoping that someone can provide me with the DAX to accomplish the following&lt;/P&gt;&lt;P&gt;Thank you for your time,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;Here is the raw data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need to add the calculated column, Difference:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Pseudo code: Rating - Base Rating for each match:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:30:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673261#M79788</guid>
      <dc:creator>bob57</dc:creator>
      <dc:date>2022-08-01T14:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673283#M79790</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198866" data-lia-user-login="bob57" class="lia-mention lia-mention-user"&gt;bob57&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;howdid you calculate the Difference?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:41:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673283#M79790</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-01T14:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673330#M79794</link>
      <description>&lt;P&gt;I did it by hand for demonstration purposes. But the algorithm would go like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each Match (1, 2, and 3) subtract the Base Rating (Rating where Base = yes) from the Rating and round to the nearest whole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation must be independent for the match so for Match = 2, for example:&lt;/P&gt;&lt;P&gt;when Tee = Red, then 65.4 - 69.7 = -4&lt;/P&gt;&lt;P&gt;when Tee = White, then 69.7 – 69.7 = 0&lt;/P&gt;&lt;P&gt;when Tee = Blue, then 71.3 – 69.7 = 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this offers the required clarity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:07:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673330#M79794</guid>
      <dc:creator>bob57</dc:creator>
      <dc:date>2022-08-01T15:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673334#M79795</link>
      <description>&lt;P&gt;My apologies. I neglected to mention that the calculation must be rounded to the nearest whole number.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:08:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673334#M79795</guid>
      <dc:creator>bob57</dc:creator>
      <dc:date>2022-08-01T15:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673384#M79799</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198866" data-lia-user-login="bob57" class="lia-mention lia-mention-user"&gt;bob57&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is a sample file with the solution&amp;nbsp;&lt;A href="https://we.tl/t-KWLD6ZeAMf" target="_blank"&gt;https://we.tl/t-KWLD6ZeAMf&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Difference = 
VAR CurrentBase = Data[Base]
VAR CurrentRating = Data[Rating]
VAR CurrentMatchYesRating = CALCULATE ( MAX ( Data[Rating] ), ALLEXCEPT ( Data, Data[Match] ), Data[Base] = "yes" )
VAR Result =
    IF (
        CurrentBase = "no",
        CurrentRating - CurrentMatchYesRating,
        0
    )
RETURN
    ROUNDDOWN ( Result, 0 )&lt;/LI-CODE&gt;&lt;P&gt;You may need to readjust the rounding type as per your requirement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:26:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673384#M79799</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-01T15:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673401#M79801</link>
      <description>&lt;P&gt;That did the trick! Thank you so much.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 15:33:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-Column/m-p/2673401#M79801</guid>
      <dc:creator>bob57</dc:creator>
      <dc:date>2022-08-01T15:33:58Z</dc:date>
    </item>
  </channel>
</rss>

