<?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: SWITCH Function for Duration values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829834#M38887</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="243841" data-lia-user-login="HelenBrunyee" class="lia-mention lia-mention-user"&gt;HelenBrunyee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;Can you share your sample pbix file?&lt;/P&gt;&lt;P&gt;I understand that you do not need extra grouping table, am I correct?&lt;/P&gt;&lt;P&gt;I think it is an issue with how to write DAX measure, but please kindly share your sample pbix file's link here, then I can try to come up with a more accurate measure.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 10:37:07 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2021-05-07T10:37:07Z</dc:date>
    <item>
      <title>SWITCH Function for Duration values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829241#M38875</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have had a good search on here to try and find someone with the same issue, but no luck, so was hoping someone would be able to help me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the DAX function SWITCH(TRUE(), to label/categorise a list of durations. I have used SWITCH plenty of times for numeric or text values, but can't seem to figure out how I would use it for durational conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a huge amount of durations(some days in length), but I am only really interested in the minutes, to get them labelled up/grouped into the following catgeories:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0-15 mins&lt;/P&gt;&lt;P&gt;16-30 mins&lt;/P&gt;&lt;P&gt;31-45 mins&lt;/P&gt;&lt;P&gt;46-60 mins&lt;/P&gt;&lt;P&gt;60+ mins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am unsure how I would go about saying "IF &amp;gt;15 minutes &amp;amp; &amp;lt;31 minutes = "16-30 mins", fo example?&lt;BR /&gt;&lt;BR /&gt;Any help would be super super appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 07:17:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829241#M38875</guid>
      <dc:creator>HelenBrunyee</dc:creator>
      <dc:date>2021-05-07T07:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: SWITCH Function for Duration values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829291#M38876</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="243841" data-lia-user-login="HelenBrunyee" class="lia-mention lia-mention-user"&gt;HelenBrunyee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if I understood correctly your question.&lt;/P&gt;&lt;P&gt;I suggest having a grouping table (separate table) like the below picture and write a measure to group the values that you want.&lt;/P&gt;&lt;P&gt;If it is OK with you, please share your sample pbix file's link here together with how you want to see your desired outcome. Then I can try to look into it to come up with a more accurate solution.&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;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 07:37:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829291#M38876</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-07T07:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: SWITCH Function for Duration values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829548#M38882</link>
      <description>&lt;P&gt;Here's my reply&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 08:59:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829548#M38882</guid>
      <dc:creator>HelenBrunyee</dc:creator>
      <dc:date>2021-05-07T08:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: SWITCH Function for Duration values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829571#M38883</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for getting back to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Sorry if I haven't explained this well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just trying to get something like the below, but using tduration conditions such as, "if greater than 15 minutes...". The below example is something I used to label locations based on postcodes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;London_Group = SWITCH(TRUE(),&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="WD","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="EN","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="HA","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="NW","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="IG","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="BR","Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="NE","Non-Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="WN","Non-Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="WF","Non-Greater London",&lt;BR /&gt;LEFT(V_LOCATIONS[Post Code],2)="WA","Non-Greater London",&lt;BR /&gt;"Non-Greater London")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I'm trying to do is write a SWITCH DAX like the above, to label my durations column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've tried something like this, but it won't work with the type as duration or with the colons:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Duration_Group = SWITCH(TRUE(),&lt;BR /&gt;[duration]&amp;lt;= 0.0:15:00, "0 - 15 Minutes",&lt;BR /&gt;[duration]&amp;gt; 0.0:15:00 &amp;amp; &amp;lt;=30, "16-30 Minutes",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps explain it a bit better! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 09:06:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829571#M38883</guid>
      <dc:creator>HelenBrunyee</dc:creator>
      <dc:date>2021-05-07T09:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: SWITCH Function for Duration values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829834#M38887</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="243841" data-lia-user-login="HelenBrunyee" class="lia-mention lia-mention-user"&gt;HelenBrunyee&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;Can you share your sample pbix file?&lt;/P&gt;&lt;P&gt;I understand that you do not need extra grouping table, am I correct?&lt;/P&gt;&lt;P&gt;I think it is an issue with how to write DAX measure, but please kindly share your sample pbix file's link here, then I can try to come up with a more accurate measure.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 10:37:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SWITCH-Function-for-Duration-values/m-p/1829834#M38887</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-07T10:37:07Z</dc:date>
    </item>
  </channel>
</rss>

