<?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: Count of event grouped by miles on automobile in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436353#M65026</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question. In you real data there would be multiple&amp;nbsp;&lt;SPAN&gt;automobiles in the same mile bin. Would you like have them all indicated in your report?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 17:09:43 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-04-04T17:09:43Z</dc:date>
    <item>
      <title>Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436211#M65016</link>
      <description>&lt;P&gt;I have a table with an event + miles for a fleet of automobiles.&amp;nbsp; I would like to calculate the total number of events over different bins of miles.&amp;nbsp; Basically trying to determine how many events occur given a range of miles.&amp;nbsp; The result would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;miles bin&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count of events&amp;nbsp; &amp;nbsp; auto id&lt;/P&gt;&lt;P&gt;----------&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -----------------&amp;nbsp; &amp;nbsp; --------&lt;/P&gt;&lt;P&gt;0-1K&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1K-10K&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where the data I have is as follows:&lt;/P&gt;&lt;P&gt;mile occurred&amp;nbsp; &amp;nbsp; &amp;nbsp;auto id&amp;nbsp; &amp;nbsp; event id&lt;/P&gt;&lt;P&gt;---------------&amp;nbsp; &amp;nbsp; &amp;nbsp; --------&amp;nbsp; &amp;nbsp;---------&lt;/P&gt;&lt;P&gt;591&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;13000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;14000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:04:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436211#M65016</guid>
      <dc:creator>sbuster</dc:creator>
      <dc:date>2022-04-04T17:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436239#M65018</link>
      <description>&lt;P&gt;Create a calculated column with and if/switch statement to calculate the range (if range &amp;lt; 1000&amp;nbsp; then "0 - 1K"....)&lt;/P&gt;&lt;P&gt;You can then create a count measure for the events to get the results needed by range&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 16:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436239#M65018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-04T16:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436339#M65023</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see that for the same&amp;nbsp;&lt;SPAN&gt;automobile same event you have multiple miles. How are we supposed to deal with that? Shall we consider the sum or the maximim value. The bins shall be based on each event or as overall?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436339#M65023</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-04T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436341#M65024</link>
      <description>&lt;P&gt;My apologies, mistyped it as each should have different event id.&amp;nbsp; fixed the example.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:05:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436341#M65024</guid>
      <dc:creator>sbuster</dc:creator>
      <dc:date>2022-04-04T17:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436353#M65026</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question. In you real data there would be multiple&amp;nbsp;&lt;SPAN&gt;automobiles in the same mile bin. Would you like have them all indicated in your report?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:09:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436353#M65026</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-04T17:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436357#M65027</link>
      <description>&lt;P&gt;yes, there are multiple autos in real data set all.&amp;nbsp; User will most likely be looking at 1 automobile at a time.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:12:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436357#M65027</guid>
      <dc:creator>sbuster</dc:creator>
      <dc:date>2022-04-04T17:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436408#M65030</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Start with creating a new column&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Mile Bins =
SWITCH (
    TRUE (),
    Data[mile occurred] &amp;gt; 0
        &amp;amp;&amp;amp; Data[mile occurred] &amp;lt; 1000, "0 - 1k",
    Data[mile occurred] &amp;gt;= 1000
        &amp;amp;&amp;amp; Data[mile occurred] &amp;lt; 10000, "1 - 10k"
)&lt;/LI-CODE&gt;&lt;P&gt;Use this column in you matrix visual.&amp;nbsp;&lt;BR /&gt;the count measure&lt;/P&gt;&lt;LI-CODE lang="php"&gt;count of events =
DISTINCTCOUNT ( Dat[auto id] )&lt;/LI-CODE&gt;&lt;P&gt;And the id's measure&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Auto Id's =
CONCATENATEX ( VALUES ( Data[auto id] ), Data[auto id], UNICHAR ( 10 ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Apr 2022 17:52:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436408#M65030</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-04T17:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436452#M65034</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;There are three ways to group/bin. This report includes two of them (Power Query has this feature as well).&lt;/P&gt;&lt;P&gt;Here is a link to an example file. I hope this helps! You can also change the bin sizes.&lt;/P&gt;&lt;P&gt;&lt;A title="Grouping Autos by Mileage" href="https://drive.google.com/file/d/1OA3NbOHCOXzVJiABNqHQggLrWR8sjtqR/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1OA3NbOHCOXzVJiABNqHQggLrWR8sjtqR/view?usp=sharing&lt;/A&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 18:47:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2436452#M65034</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-04-04T18:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2442421#M65452</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;I just want to confirm if you resolved this issue? If yes,&amp;nbsp;&lt;U&gt;you can accept the answer helpful as the solution&lt;/U&gt;&amp;nbsp;&lt;STRONG&gt;or&lt;/STRONG&gt;&amp;nbsp;&lt;U&gt;share you method and accept it as solution&lt;/U&gt;, thanks for your contribution to improve Power BI.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;STRONG&gt;&lt;SPAN&gt;If you need more help, please let me know.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Community Support Team _Tang&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 06:49:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2442421#M65452</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-04-07T06:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count of event grouped by miles on automobile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2481903#M67979</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374839" data-lia-user-login="sbuster" class="lia-mention lia-mention-user"&gt;sbuster&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;If user will most likely be looking at &lt;STRONG&gt;1 automobile at a time&lt;/STRONG&gt; then you can try this,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;just need to create an auxiliary table and a column,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;(1)&amp;nbsp;create an auxiliary table&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;miles bin = DIVIDE('miles bin'[start],1000)&amp;amp;"K-"&amp;amp;DIVIDE('miles bin'[end],1000)&amp;amp;"K"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) create a column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;miles bin = 
var _v= 'Table'[mile occurred]
var _range= CALCULATE(MAX('miles bin'[miles bin]),FILTER(ALL('miles bin'),'miles bin'[start]&amp;lt;=_v &amp;amp;&amp;amp; 'miles bin'[end]&amp;gt;_v))
return _range&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;result&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Community Support Team _Tang&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:02:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-event-grouped-by-miles-on-automobile/m-p/2481903#M67979</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-04-28T03:02:44Z</dc:date>
    </item>
  </channel>
</rss>

