<?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 Previous dates using date add and switch in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1204274#M19327</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the support. The objective is to make a measure that gives the previous aummount for any date, excluding holidays and weekends. I was using the "is holiday" and "is weekend" from the model calendar table to switch between diferents dateadd for some aggregation measure, but it gave error as result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;measure := calculate(aggregateMeasure,&lt;/P&gt;&lt;P&gt;switch(TRUE(),&lt;/P&gt;&lt;P&gt;calendar[isHoliday] = 1 and calendar[day] = 5, dateadd(calendar[date], - 4, day),&lt;/P&gt;&lt;P&gt;... //for every use case&lt;/P&gt;&lt;P&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the result is error : /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for any help&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jul 2020 16:11:28 GMT</pubDate>
    <dc:creator>Lenastray</dc:creator>
    <dc:date>2020-07-06T16:11:28Z</dc:date>
    <item>
      <title>Previous dates using date add and switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1204274#M19327</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the support. The objective is to make a measure that gives the previous aummount for any date, excluding holidays and weekends. I was using the "is holiday" and "is weekend" from the model calendar table to switch between diferents dateadd for some aggregation measure, but it gave error as result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;measure := calculate(aggregateMeasure,&lt;/P&gt;&lt;P&gt;switch(TRUE(),&lt;/P&gt;&lt;P&gt;calendar[isHoliday] = 1 and calendar[day] = 5, dateadd(calendar[date], - 4, day),&lt;/P&gt;&lt;P&gt;... //for every use case&lt;/P&gt;&lt;P&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the result is error : /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for any help&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 16:11:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1204274#M19327</guid>
      <dc:creator>Lenastray</dc:creator>
      <dc:date>2020-07-06T16:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Previous dates using date add and switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1204400#M19336</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="96252" data-lia-user-login="Lenastray" class="lia-mention lia-mention-user"&gt;Lenastray&lt;/a&gt; , Not very clear. Check if this can help&lt;/P&gt;
&lt;DIV style="box-sizing: border-box; font-family: 'Segoe UI', system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calendar-4-5-Power/ba-p/1187766" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calendar-4-5-Power/ba-p/1187766&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Jul 2020 17:07:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1204400#M19336</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-06T17:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Previous dates using date add and switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1205871#M19364</link>
      <description>Of course you get an error because SWITCH cannot return a table and tables and tables only can be filters in CALCULATE. Also, calling field names without wrapping them into an aggregation function when there's no row context must lead to errors.&lt;BR /&gt;&lt;BR /&gt;Please try to read something about CALCULATE and how filters work in DAX.&lt;BR /&gt;&lt;BR /&gt;By the way, your case is not clear at all. Please explain in detail what you want to do and then someone will certainly be able to help you.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Tue, 07 Jul 2020 08:55:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-dates-using-date-add-and-switch/m-p/1205871#M19364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-07T08:55:55Z</dc:date>
    </item>
  </channel>
</rss>

