<?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: Automatically calculate a &amp;quot;previous value&amp;quot; based on current slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354238#M172887</link>
    <description>&lt;P&gt;Thanks for&amp;nbsp;lbendlin's concern about this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="667903" data-lia-user-login="RYRY" class="lia-mention lia-mention-user"&gt;RYRY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not give me some test data to test, I assumed some data myself:&lt;/P&gt;
&lt;P&gt;DIM_Applicant:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DIM_day:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I will provide some steps below which I hope will help you:&lt;BR /&gt;First, create a calculated column in the DIM_day table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous Day of Week = 
SWITCH(
    'DIM_Day'[day_of_week],
    "Monday", "Sunday",
    "Tuesday", "Monday",
    "Wednesday", "Tuesday",
    "Thursday", "Wednesday",
    "Friday", "Thursday",
    "Saturday", "Friday",
    "Sunday", "Saturday"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Then create the following three Measure in order:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Selected Day = SELECTEDVALUE('DIM_Day'[day_of_week])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous Day = 
CALCULATE(
    MAX('DIM_Day'[Previous Day of Week]),
    FILTER(
        DIM_Day,
        'DIM_Day'[day_of_week] = [Selected Day]
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Submitted Applications Previous Day = 
CALCULATE(
    COUNT(DIM_Applicant[app_id]),
    'DIM_Applicant'[app_status] = "Active",
    FILTER(
        ALL(DIM_Applicant),
        DIM_Applicant[day_submitted] = [Previous Day]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Select Card visual and drag Measure Submitted Applications Previous Day into Card visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have attached the pbix file for this example below, I hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fen Ling,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2025 02:17:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-08T02:17:22Z</dc:date>
    <item>
      <title>Automatically calculate a "previous value" based on current slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354075#M172876</link>
      <description>&lt;P&gt;Let's say, I have two slicers:&lt;/P&gt;&lt;P&gt;1. Days of the Week (Monday through to Sunday in that order)&lt;/P&gt;&lt;P&gt;2. Previous Day of the Week (same as above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both slicers have seven values each and are identical. What I am wanting to achieve is to eliminate the need of the second slicer by only using the first one. If I select a value on the first slicer, the "previous day" should be selected on the second slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using these slicers days to calculate something, so ideally, I'd like to not have to use a second slicer but reference a measure (or some calulated value) that is based on the first slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my attempt at a calculate function but I get a syntax error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Submitted Applications Previous Day&lt;/STRONG&gt; =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_Applicant&lt;/SPAN&gt;&lt;SPAN&gt;[app_id]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'DIM_Applicant'&lt;/SPAN&gt;&lt;SPAN&gt;[app_status]&lt;/SPAN&gt;&amp;nbsp;= "Active"&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;REMOVEFILTERS&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DIM_Applicant&lt;/SPAN&gt;&lt;SPAN&gt;[day_submitted]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Previous Day]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My [previous day] is a measure I created like so&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Previous Day&lt;/STRONG&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DIM_Day'&lt;/SPAN&gt;&lt;SPAN&gt;[day_of_week]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DIM_Day'&lt;/SPAN&gt;&lt;SPAN&gt;[day_number]&lt;/SPAN&gt;&lt;SPAN&gt;) -&lt;/SPAN&gt;&lt;SPAN&gt;1&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;&lt;SPAN&gt;My error is&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 22:37:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354075#M172876</guid>
      <dc:creator>RYRY</dc:creator>
      <dc:date>2025-01-07T22:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically calculate a "previous value" based on current slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354117#M172881</link>
      <description>&lt;P&gt;use + instead of &amp;amp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 23:12:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354117#M172881</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-07T23:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically calculate a "previous value" based on current slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354123#M172882</link>
      <description>&lt;P&gt;My [previous day] measure works out with no errors. It's when referencing this measure in the calculate function it gets the synrax error.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 23:26:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354123#M172882</guid>
      <dc:creator>RYRY</dc:creator>
      <dc:date>2025-01-07T23:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically calculate a "previous value" based on current slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354238#M172887</link>
      <description>&lt;P&gt;Thanks for&amp;nbsp;lbendlin's concern about this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="667903" data-lia-user-login="RYRY" class="lia-mention lia-mention-user"&gt;RYRY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not give me some test data to test, I assumed some data myself:&lt;/P&gt;
&lt;P&gt;DIM_Applicant:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DIM_day:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I will provide some steps below which I hope will help you:&lt;BR /&gt;First, create a calculated column in the DIM_day table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous Day of Week = 
SWITCH(
    'DIM_Day'[day_of_week],
    "Monday", "Sunday",
    "Tuesday", "Monday",
    "Wednesday", "Tuesday",
    "Thursday", "Wednesday",
    "Friday", "Thursday",
    "Saturday", "Friday",
    "Sunday", "Saturday"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Then create the following three Measure in order:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Selected Day = SELECTEDVALUE('DIM_Day'[day_of_week])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous Day = 
CALCULATE(
    MAX('DIM_Day'[Previous Day of Week]),
    FILTER(
        DIM_Day,
        'DIM_Day'[day_of_week] = [Selected Day]
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Submitted Applications Previous Day = 
CALCULATE(
    COUNT(DIM_Applicant[app_id]),
    'DIM_Applicant'[app_status] = "Active",
    FILTER(
        ALL(DIM_Applicant),
        DIM_Applicant[day_submitted] = [Previous Day]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Select Card visual and drag Measure Submitted Applications Previous Day into Card visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have attached the pbix file for this example below, I hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Fen Ling,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 02:17:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Automatically-calculate-a-quot-previous-value-quot-based-on/m-p/4354238#M172887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-08T02:17:22Z</dc:date>
    </item>
  </channel>
</rss>

