<?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: Previous Workday in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1751941#M36513</link>
    <description>&lt;P&gt;Perfect, thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 12:45:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-29T12:45:32Z</dc:date>
    <item>
      <title>Previous Workday</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1748432#M36370</link>
      <description>&lt;P&gt;So I have a calendar table and was able to create a calculated column that tags each workday with a 1.&amp;nbsp; How would I create a calculated column to tag a day as the previous workday?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the dax for my workday column...&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WorkDay = IF(OR('Calendar'[WeekDay]=1,'Calendar'[WeekDay]=7),0,IF(ISBLANK('Calendar'[Holiday]),1,0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1748432#M36370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-26T14:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Workday</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1749107#M36401</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just confirming, are you wanting a 0/1 flag that is equal to 1 for the workday immediately before the current date when the table is refreshed/processed (i.e. TODAY() )?&lt;/P&gt;
&lt;P&gt;If so, something like this should work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous WorkDay = 
VAR ReferenceDate = TODAY ()
VAR MaxWorkDayBeforeReferenceDate =
    CALCULATE (
        MAX ( 'Calendar'[Date] ),
        ALL ( 'Calendar' ),
        'Calendar'[Date] &amp;lt; ReferenceDate,
        'Calendar'[WorkDay] = 1
    )
RETURN
    INT ( 'Calendar'[Date] = MaxWorkDayBeforeReferenceDate )&lt;/LI-CODE&gt;
&lt;P&gt;If you instead want a column that returns the date of the workday preceding the current row's date, something like this should work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous WorkDay Date = 
VAR ReferenceDate = 'Calendar'[Date]
RETURN
    CALCULATE (
        MAX ( 'Calendar'[Date] ),
        ALL ( 'Calendar' ),
        'Calendar'[Date] &amp;lt; ReferenceDate,
        'Calendar'[WorkDay] = 1
    )&lt;/LI-CODE&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Sat, 27 Mar 2021 00:19:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1749107#M36401</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2021-03-27T00:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Workday</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1751941#M36513</link>
      <description>&lt;P&gt;Perfect, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 12:45:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Workday/m-p/1751941#M36513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-29T12:45:32Z</dc:date>
    </item>
  </channel>
</rss>

