<?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: Add Calculated Column of Median of Multiple Values of Each Row in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3987168#M154563</link>
    <description>&lt;P&gt;As I have other columns in the table and have few meausres that need to count row, I don't want to change the table structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the last method you mentioned, can I know what is [value]?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 01:11:31 GMT</pubDate>
    <dc:creator>superhayan</dc:creator>
    <dc:date>2024-06-12T01:11:31Z</dc:date>
    <item>
      <title>Add Calculated Column of Median of Multiple Values of Each Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3986965#M154551</link>
      <description>&lt;P&gt;Hello all, I have a seemingly simple question but I don't know how to get the right DAX formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sample data. I have columns A-D and now need to add a calculated column to calculate the median of col B, C, D of each row, while the values in these 3 columns must not be 0.&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;An excel-equivalent formula of cell E2 will be =MEDIAN(FILTER(B2:D2,B2:D2&amp;lt;&amp;gt;0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the DAX formula I should put in the calculatd colum without needing to unpivot the columns BCD? Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 21:21:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3986965#M154551</guid>
      <dc:creator>superhayan</dc:creator>
      <dc:date>2024-06-11T21:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add Calculated Column of Median of Multiple Values of Each Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3987159#M154562</link>
      <description>&lt;P&gt;The best solution would be to change your table structure. I went back into powerquery and unpivoted to get this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best practice is to not use a calculated column unless you need to. If you must, then the following DAX should work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;median = CONVERT(MEDIANX(
    CALCULATETABLE('Table', ALLEXCEPT('Table', 'Table'[Product])), 
    'Table'[Price]
), INTEGER)&lt;/LI-CODE&gt;
&lt;P&gt;Note: the convert is necessary&lt;/P&gt;
&lt;P&gt;If you can't change your data for whatever reason, then the following should give the same result:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;median = CONVERT(MEDIANX(
    {'Table'[Shop A], 'Table'[Shop B], 'Table'[Shop C]}, 
    [Value]
), INTEGER)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 00:59:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3987159#M154562</guid>
      <dc:creator>vicky_</dc:creator>
      <dc:date>2024-06-12T00:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add Calculated Column of Median of Multiple Values of Each Row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3987168#M154563</link>
      <description>&lt;P&gt;As I have other columns in the table and have few meausres that need to count row, I don't want to change the table structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the last method you mentioned, can I know what is [value]?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 01:11:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-Calculated-Column-of-Median-of-Multiple-Values-of-Each-Row/m-p/3987168#M154563</guid>
      <dc:creator>superhayan</dc:creator>
      <dc:date>2024-06-12T01:11:31Z</dc:date>
    </item>
  </channel>
</rss>

