<?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: how to crate dynamic Bucket field in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2336289#M58863</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you followed the DAX formula posted by tamerj1 to find the solution to your problem?&lt;/P&gt;
&lt;P&gt;If so, would you like to mark his reply as a solution so that others can learn from it too?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 08:46:12 GMT</pubDate>
    <dc:creator>v-robertq-msft</dc:creator>
    <dc:date>2022-02-14T08:46:12Z</dc:date>
    <item>
      <title>how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327401#M58323</link>
      <description>&lt;P&gt;hi all,&amp;nbsp;&lt;BR /&gt;i have data like below table, based on that i want to creat calculate colum (Usage Bucket) in DAX&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;i have Month Start Date &amp;amp;&amp;nbsp;Geo Continent Filter&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Scenario 1: I did not apply any filter&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;i want to show this bar chart&lt;STRONG&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Scenario 2: I selected 01/Jan/2021 in Month start date&lt;BR /&gt;&lt;/STRONG&gt;i want to show this bar chart&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Scenario 3: I selected 01/Jan/2021 in Month start date &amp;amp; selected&amp;nbsp;Asia in&amp;nbsp;Geo Continent&lt;BR /&gt;&lt;/STRONG&gt;i want to show this bar chart&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Raw Data&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month Start Date&lt;/TD&gt;&lt;TD&gt;Geo Continent&lt;/TD&gt;&lt;TD&gt;User Id&lt;/TD&gt;&lt;TD&gt;No Time Used&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-2021&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;ID1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-2021&lt;/TD&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;ID1&lt;/TD&g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lt;/TD&gt;&lt;TD&gt;Africa&lt;/TD&gt;&lt;TD&gt;ID3&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Feb-2021&lt;/TD&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;ID3&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-2021&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;ID4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Jan-2021&lt;/TD&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;ID4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Feb-2021&lt;/TD&gt;&lt;TD&gt;Africa&lt;/TD&gt;&lt;TD&gt;ID4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1-Feb-2021&lt;/TD&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;TD&gt;ID4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 06:49:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327401#M58323</guid>
      <dc:creator>vengadesh_p</dc:creator>
      <dc:date>2022-02-09T06:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327567#M58332</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332372" data-lia-user-login="vengadesh_p" class="lia-mention lia-mention-user"&gt;vengadesh_p&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can create a column with below code:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column =
VAR times_used =
    CALCULATE (
        SUM ( 'Table (2)'[No Time Used] ),
        FILTER (
            ALL ( 'Table (2)' ),
            'Table (2)'[User Id] = EARLIER ( 'Table (2)'[User Id] )
        )
    )
RETURN
    SWITCH (
        TRUE (),
        times_used &amp;lt; 5, "Less than 5 times used",
        times_used &amp;gt;= 5
            &amp;amp;&amp;amp; times_used &amp;lt; 10, "5 to 10 times used",
        times_used &amp;gt;= 10
            &amp;amp;&amp;amp; times_used &amp;lt; 20, "10 to 20 times used",
        times_used &amp;gt;= 20, "More than 20 time used"
    )&lt;/LI-CODE&gt;&lt;P&gt;Now add newly create column on table visual and add ID column summerized as distinctcount.&lt;/P&gt;&lt;P&gt;Output:-&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Refer file below:-&lt;/P&gt;&lt;P&gt;&lt;A href="https://we.tl/t-3ASbNM9A1D" target="_self"&gt;https://we.tl/t-3ASbNM9A1D&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samarth&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 07:58:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327567#M58332</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2022-02-09T07:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327790#M58346</link>
      <description>&lt;P&gt;Thanks you for your responce&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I selected Asia, it show wrong information&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX: ID2 &amp;amp; ID4 used less than 5 time but it shows wrong result&lt;BR /&gt;&lt;STRONG&gt;"Less than 5 times" used should be 2&lt;/STRONG&gt;&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;</description>
      <pubDate>Wed, 09 Feb 2022 09:24:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327790#M58346</guid>
      <dc:creator>vengadesh_p</dc:creator>
      <dc:date>2022-02-09T09:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327990#M58361</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332372" data-lia-user-login="vengadesh_p" class="lia-mention lia-mention-user"&gt;vengadesh_p&lt;/a&gt;&amp;nbsp;, Try this:-&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column = 
VAR times_used =
    CALCULATE (
        SUM ( 'Table (2)'[No Time Used] ),
        FILTER (
            ALL ( 'Table (2)' ),
            'Table (2)'[User Id] = EARLIER ( 'Table (2)'[User Id] ) &amp;amp;&amp;amp;
            'Table (2)'[Geo Continent] = EARLIER('Table (2)'[Geo Continent])
        )
    )
RETURN
    SWITCH (
        TRUE (),
        times_used &amp;lt; 5, "Less than 5 times used",
        times_used &amp;gt;= 5
            &amp;amp;&amp;amp; times_used &amp;lt; 10, "5 to 10 times used",
        times_used &amp;gt;= 10
            &amp;amp;&amp;amp; times_used &amp;lt; 20, "10 to 20 times used",
        times_used &amp;gt;= 20, "More than 20 time used"
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Feb 2022 10:45:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2327990#M58361</guid>
      <dc:creator>Samarth_18</dc:creator>
      <dc:date>2022-02-09T10:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2328157#M58372</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332372" data-lia-user-login="vengadesh_p" class="lia-mention lia-mention-user"&gt;vengadesh_p&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please refer to the sample solution file here&amp;nbsp;&lt;A href="https://www.dropbox.com/t/UTrpT9QkiFfUEQmz" target="_blank" rel="noopener"&gt;https://www.dropbox.com/t/UTrpT9QkiFfUEQmz&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Basically creating a calculated column is not going to help. Therefore, the only solution is to create a measure relaying on a seperate table that contains the "Bucket" names.&lt;BR /&gt;&lt;BR /&gt;Just open the file and have a look at the code which is too long to be posted in a comment here.&lt;BR /&gt;&lt;BR /&gt;This is how the report looks like&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;If my answer satisfies your requirement, I kindly request you to mark it as Accepted. Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 11:59:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2328157#M58372</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-09T11:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2330964#M58579</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332372" data-lia-user-login="vengadesh_p" class="lia-mention lia-mention-user"&gt;vengadesh_p&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please let me know if my reply solved your proble. If so, kindly mark it as accepted solution. Kudos are also appreciated. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 13:46:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2330964#M58579</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-10T13:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2336289#M58863</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you followed the DAX formula posted by tamerj1 to find the solution to your problem?&lt;/P&gt;
&lt;P&gt;If so, would you like to mark his reply as a solution so that others can learn from it too?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 08:46:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2336289#M58863</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2022-02-14T08:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to crate dynamic Bucket field in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2336316#M58866</link>
      <description>&lt;P&gt;Here is the code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;# User = 
VAR CurrentBucket = SELECTEDVALUE (Buckets[Usage Bucket] )
VAR UserTotal =
    SUMMARIZE (
        Data,
        Data[User Id],
        "@TotalPerUser", SUM (Data[No Time Used] )
    )
VAR LessThan5 =
    FILTER ( 
        UserTotal,
        [@TotalPerUser] &amp;lt; 5
    )
VAR LessThan5Count = COUNTROWS ( LessThan5 )
VAR LessThan5Users =
    CONCATENATEX (
        LessThan5,
        Data[User Id],
        ", ",
        Data[User Id], ASC
    )
VAR Between5and9 =
    FILTER ( 
        UserTotal,
        [@TotalPerUser] &amp;gt;= 5 &amp;amp;&amp;amp; [@TotalPerUser] &amp;lt; 10
    )
VAR Between5and9Count = COUNTROWS ( Between5and9 )
VAR Between5and9Users =
    CONCATENATEX (
        Between5and9,
        Data[User Id],
        ", ",
        Data[User Id], ASC
    )
VAR Between10and19 =
    FILTER ( 
        UserTotal,
        [@TotalPerUser] &amp;gt;= 10 &amp;amp;&amp;amp; [@TotalPerUser] &amp;lt; 20
    )
VAR Between10and19Count = COUNTROWS ( Between10and19 )
VAR Between10and19Users =
    CONCATENATEX (
        Between10and19,
        Data[User Id],
        ", ",
        Data[User Id], ASC
    )
VAR MoreThan20 =
    FILTER ( 
        UserTotal,
        [@TotalPerUser] &amp;gt;= 20
    )
VAR MoreThan20Count = COUNTROWS ( MoreThan20 )
VAR MoreThan20Users =
    CONCATENATEX (
        MoreThan20,
        Data[User Id],
        ", ",
        Data[User Id], ASC
    )
VAR Result =
    SWITCH ( 
        TRUE,
        CurrentBucket = "Less Than 5 Times Used", LessThan5Count &amp;amp; " - " &amp;amp; LessThan5Users,
        CurrentBucket = "5 to 9 Times Used", Between5and9Count &amp;amp; " - " &amp;amp; Between5and9Users,
        CurrentBucket = "10 to 19 Times Used", Between10and19Count &amp;amp; " - " &amp;amp; Between10and19Users,
        MoreThan20Count &amp;amp; " - " &amp;amp; MoreThan20Users
    )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Feb 2022 08:57:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-crate-dynamic-Bucket-field-in-DAX/m-p/2336316#M58866</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-14T08:57:04Z</dc:date>
    </item>
  </channel>
</rss>

