<?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: Select filtered AND unfiltered values in one column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199469#M19136</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have something for you which assumes this data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So you have a list of offical reps and unoffical reps.&lt;/P&gt;&lt;P&gt;When you drag in the list of offical reps, the sales of the unoffical reps will be equally added:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This works by using the characteristic that some sales is blank, which is the sales of the unoffical reps. its broken down into pieces here.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NoOfficialRepSales = CALCULATE(SUM(Sales[Sales Amount]);ISBLANK('Official Rep'[Rep])) &lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;NumberOfOfficalSalesReps = CALCULATE(COUNTX('Official Rep';SUM(Sales[Sales Amount])); ALLSELECTED('Official Rep'[Rep]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;AdditionalDistributedUnOfficialSales = DIVIDE([NoOfficialRepSales];[NumberOfOfficalSalesReps])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;TotalSales =
IF (
    HASONEVALUE ( 'Official Rep'[Rep] );
    IF (
        NOT ( ISBLANK ( SELECTEDVALUE ( Sales[Rep] ) ) );
        SUM ( Sales[Sales Amount] ) + [AdditionalDistributedUnOfficialSales];
        BLANK ()
    );
    SUMX (
        ALLSELECTED ( 'Official Rep'[Rep] );
        CALCULATE ( SUM ( Sales[Sales Amount] ) )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to file &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdkRcXWEOJquTbHthg?e=MvfCaB" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hope it works for you, if so, pls mark as solution. Thumbs up for the effort is appreciated.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NumberOfOfficalSalesReps should be labeled: NumberOfUNOffialSalesRepsales&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2020 05:42:21 GMT</pubDate>
    <dc:creator>stevedep</dc:creator>
    <dc:date>2020-07-03T05:42:21Z</dc:date>
    <item>
      <title>Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1198754#M19111</link>
      <description>&lt;P&gt;Hello, Pundits!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one column with dates, one column with five distinct names (multiple rows of each name, though) and another column with the respective sales made for that particular name and date (again multiple rows). Basically, a day-by-day sales tracker made in Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are supposed to be just three salespersons on record, for billing purposes, though there is no limit on the number of people who can make sales over telephone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What Im trying to do, is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. filter the sales for the three official salespersons into one column&lt;/P&gt;&lt;P&gt;2. filter the sales for the other two into another column&lt;/P&gt;&lt;P&gt;3. somehow distribute, evenly, the sales for the two unofficial salespersons, across the official three.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive been wrangling with sumx(filter combinations for a while now, and am reaching nowhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Searching across here and Google didnt really help, either, I understand the basics okay, i think, but maybe I'm dumber than I think I am.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any help anyone would be kind enough to send my way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the closest I've come to getting anywhere is the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FilteredValues = IF(Sales[Sales]=0,0,SUMX(FILTER(Sales,OR(Sales[EmpId]=280,Sales[EmpId]=508)),Sales[Sales])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Jul 2020 19:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1198754#M19111</guid>
      <dc:creator>CC2019</dc:creator>
      <dc:date>2020-07-02T19:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199439#M19132</link>
      <description>You can use the || as an OR filter to get the three Sales people into the one FILTER expression (just replace the 209 with the ID you want):&lt;BR /&gt;&lt;BR /&gt;IF(Sales[Sales]=0,0,SUMX(FILTER(Sales,Sales[EmpId]=280||Sales[EmpId]=508||Sales[EmpId]=209),Sales[Sales]))&lt;BR /&gt;&lt;BR /&gt;Are you happy having the employee id hard coded into the measure?&lt;BR /&gt;&lt;BR /&gt;Once you've got the part above working, you'll need to do something similar to add the remaining sales, but will probably need to use ALL or something else to clear filters on that part depending on what visual you want to use it in.&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jul 2020 04:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199439#M19132</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-07-03T04:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199469#M19136</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have something for you which assumes this data model:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So you have a list of offical reps and unoffical reps.&lt;/P&gt;&lt;P&gt;When you drag in the list of offical reps, the sales of the unoffical reps will be equally added:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This works by using the characteristic that some sales is blank, which is the sales of the unoffical reps. its broken down into pieces here.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NoOfficialRepSales = CALCULATE(SUM(Sales[Sales Amount]);ISBLANK('Official Rep'[Rep])) &lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;NumberOfOfficalSalesReps = CALCULATE(COUNTX('Official Rep';SUM(Sales[Sales Amount])); ALLSELECTED('Official Rep'[Rep]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;AdditionalDistributedUnOfficialSales = DIVIDE([NoOfficialRepSales];[NumberOfOfficalSalesReps])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;TotalSales =
IF (
    HASONEVALUE ( 'Official Rep'[Rep] );
    IF (
        NOT ( ISBLANK ( SELECTEDVALUE ( Sales[Rep] ) ) );
        SUM ( Sales[Sales Amount] ) + [AdditionalDistributedUnOfficialSales];
        BLANK ()
    );
    SUMX (
        ALLSELECTED ( 'Official Rep'[Rep] );
        CALCULATE ( SUM ( Sales[Sales Amount] ) )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to file &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdkRcXWEOJquTbHthg?e=MvfCaB" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hope it works for you, if so, pls mark as solution. Thumbs up for the effort is appreciated.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NumberOfOfficalSalesReps should be labeled: NumberOfUNOffialSalesRepsales&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 05:42:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199469#M19136</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-07-03T05:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199541#M19141</link>
      <description>&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That worked a CHARM! Exactly what I had in mind, while wrangling with the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had the separate tables, couldn't quite get them to play together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your post just makes everything so very clear and simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, Sir!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 05:42:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199541#M19141</guid>
      <dc:creator>CC2019</dc:creator>
      <dc:date>2020-07-03T05:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199545#M19142</link>
      <description>&lt;P&gt;Happy to read and glad to be of help!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 05:43:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199545#M19142</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-07-03T05:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select filtered AND unfiltered values in one column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199573#M19143</link>
      <description>&lt;P&gt;Hi Allison,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, that works. ALL helps with the remaining sales, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did plug this in, and get the results I wanted, yet have decided to use Steve's solution as it is something new for me to learn and add to the knowledge base.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wonderful community, this, always amazing people helping out. I'm in awe.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 05:51:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Select-filtered-AND-unfiltered-values-in-one-column/m-p/1199573#M19143</guid>
      <dc:creator>CC2019</dc:creator>
      <dc:date>2020-07-03T05:51:26Z</dc:date>
    </item>
  </channel>
</rss>

