<?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: Return table instead of distinctcount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2973613#M99489</link>
    <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you have time to look over my questions?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2022 14:40:18 GMT</pubDate>
    <dc:creator>Ja-Ju</dc:creator>
    <dc:date>2022-12-16T14:40:18Z</dc:date>
    <item>
      <title>Return table instead of distinctcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2848393#M91206</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;My measures work quite well, but I am doing calculations and distinctcounts.&lt;/P&gt;&lt;P&gt;Because of this, it is impossible for me, to tell some other people, which data is behind. I can just answer "we have 107 users for this or this purpose", but cannot give them a list.&lt;/P&gt;&lt;P&gt;I would like to change that but am struggling with the DAX functions.&lt;/P&gt;&lt;P&gt;Here is what I am currently doing.&lt;/P&gt;&lt;P&gt;The first measure gives me the count of users, for whom it would be possible to use our software for time booking.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;suppliers_able_to_book = 
VAR __COUNT = CALCULATE (
DISTINCTCOUNT ( table[Login_mail] ),
    FILTER(
        KEEPFILTERS(VALUES('table'[End_Datum])),
        AND(
        'table'[End_Date] &amp;gt;= TODAY(),
        'table'[End_Date] &amp;lt; DATE(2099, 11, 23)
        )
    ),
    FILTER(
        KEEPFILTERS(VALUES('table'[Start_Date])),
        AND(
        'table'[Start_Date] &amp;lt;= TODAY(),
        'table'[Start_Date] &amp;gt; DATE(1993, 11, 23)
        )
    ),
    FILTER(
        KEEPFILTERS(VALUES('table'[Login_mail])),
        NOT('table'[Login_mail] IN {BLANK()})
    ),
    FILTER(
        KEEPFILTERS(VALUES('table'[fixed_price])),
        NOT('table'[fixed_price] IN {1})
    )
)

RETURN
  IF(
   NOT ISBLANK(__COUNT),
   __COUNT,
        IF(
        ISBLANK(__COUNT),
        0
        )
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second measure gives me the amount of users, who are actually doing it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;suppliers_booking_hours = 
VAR __COUNT = CALCULATE (
DISTINCTCOUNT ( table[Login_mail] ),
    FILTER(
        KEEPFILTERS(VALUES('table'[End_Date])),
        AND(
        'table'[End_Date] &amp;gt;= TODAY(),
        'table'[End_Date] &amp;lt; DATE(2099, 11, 23)
        )
    ),
    FILTER(
        KEEPFILTERS(VALUES('table'[Start_Date])),
        AND(
        'table'[Start_Date] &amp;lt;= TODAY(),
        'table'[Start_Date] &amp;gt; DATE(1993, 11, 23)
        )
    ),
    FILTER(
        KEEPFILTERS(VALUES('table'[booking_hours])),
        NOT('table'[booking_hours] IN {BLANK()})
    )
)

RETURN
  IF(
   NOT ISBLANK(__COUNT),
   __COUNT,
        IF(
        ISBLANK(__COUNT),
        0
        )
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third measure gives me the difference between these two values. The outcoming is the amount of suppliers, not using our tool for time booking.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;supplier_not_booking = 
VAR __COUNT = CALCULATE (
table[supplier_able_to_book] - table[suppliers_booking_hours]
)

RETURN
  IF(
   NOT ISBLANK(__COUNT),
   __COUNT,
        IF(
        ISBLANK(__COUNT),
        0
        )
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to get a table back with the actual values, who are the people.&lt;/P&gt;&lt;P&gt;I tried to transform these queries, to get a table back instead of a fixed number, but failed on that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem, why it does not work in the PowerBI Desktop UI (or I did not find a way) is, that normal filtering of values does not work here.&lt;/P&gt;&lt;P&gt;I have a table with multiple rows containing:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;project, order, supplier, time_booking (yes/no)&lt;/P&gt;&lt;P&gt;The supplier can be there multiple times but I want to get only these ones, that never booked on any order.&lt;/P&gt;&lt;P&gt;If I use the filtering in the UI, I get more than with my measures and I could prove, that there are some included, that booked already on some other element of the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there someone around who can help me with this?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 07:48:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2848393#M91206</guid>
      <dc:creator>Ja-Ju</dc:creator>
      <dc:date>2022-10-18T07:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Return table instead of distinctcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2850490#M91340</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="458044" data-lia-user-login="Ja-Ju" class="lia-mention lia-mention-user"&gt;Ja-Ju&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 07:04:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2850490#M91340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-19T07:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return table instead of distinctcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2856988#M91865</link>
      <description>&lt;P&gt;Hello Liu Yang,&lt;/P&gt;&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Edit: sample files removed from server -&amp;nbsp;&lt;/P&gt;&lt;P&gt;The outcome what I would like to acheive is a table with the data behind the value "suppliers_not_booking".&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jakob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 13:07:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2856988#M91865</guid>
      <dc:creator>Ja-Ju</dc:creator>
      <dc:date>2022-12-28T13:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Return table instead of distinctcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2973613#M99489</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you have time to look over my questions?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 14:40:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2973613#M99489</guid>
      <dc:creator>Ja-Ju</dc:creator>
      <dc:date>2022-12-16T14:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return table instead of distinctcount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2991703#M100684</link>
      <description>&lt;P&gt;For future users with the same problem looking for a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved it by creating a table and using the "sum" feature on the data field in order to get the amount of bookings for each user.&lt;/P&gt;&lt;P&gt;In the filter it is possible to add "blank", so only empty rows are displayed. It is necessary to enable "show elements without data", which can be found as option in one of the data fields / columns.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 13:06:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-table-instead-of-distinctcount/m-p/2991703#M100684</guid>
      <dc:creator>Ja-Ju</dc:creator>
      <dc:date>2022-12-28T13:06:22Z</dc:date>
    </item>
  </channel>
</rss>

