<?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 Trying to add one more condition on this measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4237750#M167633</link>
    <description>&lt;P&gt;I have bottom measure that I came up from help of the community back in 2021.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-option-in-Calculate-to-take-Max-range-only/m-p/1807061#M38155" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-option-in-Calculate-to-take-Max-range-only/m-p/1807061#M38155&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently realized that I am missing one more criteria.&lt;/P&gt;&lt;P&gt;I have uploaded &lt;A href="https://drive.google.com/file/d/1b17lTtP6NCV1RshE9h8sa9rnRXGLxqpW/view?usp=sharing" target="_self"&gt;my PBIX file here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, bottom is screenshot of a measure:&lt;/P&gt;&lt;P&gt;(sorry for such a weird long name of table (vw_MxTtWghtdHlthSrvyScr) as I tried to rename, but I got error so I could not change.)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I got the measure back in 2021, I did not think that this only retrieves one result out of &lt;STRONG&gt;all data&lt;/STRONG&gt;, not filtering &lt;STRONG&gt;current month&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where this measure is located in the file:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I need to &lt;STRONG&gt;&lt;U&gt;add one more criteria&lt;/U&gt;&lt;/STRONG&gt; to get the result from &lt;STRONG&gt;Selected month&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;In this case, it would be September 2024.&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can you add that criteria to the existing measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if the measure is modified, I should see &lt;STRONG&gt;2&lt;/STRONG&gt; for the result on the bottom:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Avi:&lt;/P&gt;&lt;P&gt;Input: 52 --&amp;gt; 3 (forecast star)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;53 --&amp;gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;54 --&amp;gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2024 16:31:56 GMT</pubDate>
    <dc:creator>JustinDoh1</dc:creator>
    <dc:date>2024-10-11T16:31:56Z</dc:date>
    <item>
      <title>Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4237750#M167633</link>
      <description>&lt;P&gt;I have bottom measure that I came up from help of the community back in 2021.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-option-in-Calculate-to-take-Max-range-only/m-p/1807061#M38155" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-option-in-Calculate-to-take-Max-range-only/m-p/1807061#M38155&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently realized that I am missing one more criteria.&lt;/P&gt;&lt;P&gt;I have uploaded &lt;A href="https://drive.google.com/file/d/1b17lTtP6NCV1RshE9h8sa9rnRXGLxqpW/view?usp=sharing" target="_self"&gt;my PBIX file here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, bottom is screenshot of a measure:&lt;/P&gt;&lt;P&gt;(sorry for such a weird long name of table (vw_MxTtWghtdHlthSrvyScr) as I tried to rename, but I got error so I could not change.)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I got the measure back in 2021, I did not think that this only retrieves one result out of &lt;STRONG&gt;all data&lt;/STRONG&gt;, not filtering &lt;STRONG&gt;current month&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where this measure is located in the file:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I need to &lt;STRONG&gt;&lt;U&gt;add one more criteria&lt;/U&gt;&lt;/STRONG&gt; to get the result from &lt;STRONG&gt;Selected month&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;In this case, it would be September 2024.&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can you add that criteria to the existing measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if the measure is modified, I should see &lt;STRONG&gt;2&lt;/STRONG&gt; for the result on the bottom:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Avi:&lt;/P&gt;&lt;P&gt;Input: 52 --&amp;gt; 3 (forecast star)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;53 --&amp;gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;54 --&amp;gt; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 16:31:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4237750#M167633</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2024-10-11T16:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4237979#M167649</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I don't fully understand the logic behind the measure, but please try something like below if you want to add one more condition that is coming from the date bridge processing date slicer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ForecastStar =
IF (
    HASONEVALUE ( 'Table'[Provider Name] ),
    VAR CurrentTestValue = forecast[Forecast]
    VAR _processingdate =
        MAX ( 'Date Bridge'[ProcessingDate] )
    RETURN
        CALCULATE (
            SELECTEDVALUE ( vw_MxTtWghtdHlthSrvyScr[HealthInspectionRating] ),
            TOPN (
                1,
                FILTER (
                    ALL ( vw_MxTtWghtdHlthSrvyScr ),
                    CurrentTestValue &amp;lt;= vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS]
                        &amp;amp;&amp;amp; _processingdate = vw_MxTtWghtdHlthSrvyScr[ProcessingDate]
                ),
                vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS], ASC
            )
        )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 03:00:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4237979#M167649</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-11T03:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4238068#M167652</link>
      <description>&lt;P&gt;&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;I think your solution is correct. I need to test more tomorrow, but so far it looks fine. I will update the status tomorrow. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 04:09:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4238068#M167652</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2024-10-11T04:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239163#M167720</link>
      <description>&lt;P&gt;&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;I would like to adjust my requirement little bit (Sorry).&lt;/P&gt;&lt;P&gt;Instead of using &lt;STRONG&gt;Max&lt;/STRONG&gt;, how can we adjust to "&lt;STRONG&gt;selected&lt;/STRONG&gt; ProcessingDate"?&lt;/P&gt;&lt;P&gt;(So, if use select August 2024, it would take the value from that month, so forth.)&lt;/P&gt;&lt;P&gt;I thought MAX would solve the issue, but I think there is other scenario that it would not work.&lt;BR /&gt;Thank you for help again!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 16:29:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239163#M167720</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2024-10-11T16:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239500#M167763</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I saw that the slicer on the page is set up as "single selection". So, I think, it still shows the same result when you try to use SELECTEDVALUE DAX function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/selectedvalue-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;SELECTEDVALUE function - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I quite do not understand about the meaning of "the other scenario".&lt;/P&gt;
&lt;P&gt;Perhaps, if you are describing about selecting multiple dates from the slicer, please try to write something like below, and try to use &lt;STRONG&gt;IN&lt;/STRONG&gt; operator in the formula.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/dax-operator-reference#logical-operators?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;DAX operators - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ForecastStar =
IF (
    HASONEVALUE ( 'Table'[Provider Name] ),
    VAR CurrentTestValue = forecast[Forecast]
    VAR _processingdate =
        VALUES ( 'Date Bridge'[ProcessingDate] )
    RETURN
        CALCULATE (
            SELECTEDVALUE ( vw_MxTtWghtdHlthSrvyScr[HealthInspectionRating] ),
            TOPN (
                1,
                FILTER (
                    ALL ( vw_MxTtWghtdHlthSrvyScr ),
                    CurrentTestValue &amp;lt;= vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS]
                        &amp;amp;&amp;amp; vw_MxTtWghtdHlthSrvyScr[ProcessingDate] IN _processingdate
                ),
                vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS], ASC
            )
        )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 07:27:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239500#M167763</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-12T07:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239691#M167778</link>
      <description>&lt;P&gt;&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;Thank you so much again.&lt;/P&gt;&lt;P&gt;I will review more closely on Monday, and let you know.&lt;/P&gt;&lt;P&gt;Regards to "other scenario", I meant "if I select other month, beside Sept 2024".&lt;/P&gt;&lt;P&gt;I think this measure should work, but I want to make sure.&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 17:50:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4239691#M167778</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2024-10-12T17:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4243515#M168003</link>
      <description>&lt;P&gt;&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;I have a question. You mentioned that you were using SELECTEDVALUE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what you have added was not using SELECTEDVALUE, so I am wondering what you meant by.&lt;/P&gt;&lt;P&gt;I had SELECTEDVALUE earlier.&lt;/P&gt;&lt;P&gt;It was using just "Values", no?&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 17:56:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4243515#M168003</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2024-10-15T17:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to add one more condition on this measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4243973#M168027</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;SELECTEDVALUE DAX function returns value.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/selectedvalue-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;SELECTEDVALUE function - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VALUES DAX function returns a column(or a list) or a table.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/values-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;VALUES function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If only one value is selected from the slicer (in your sample), I think selectedvalue dax fuction is OK to use.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/best-practices/dax-selectedvalue?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;Use SELECTEDVALUE instead of VALUES in DAX - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF more than one values are selected from the slicer (I misunderstood your second question when you mentioned about "other scenario"), it is good to use IN operatoer with VALUES or DISTINCT or other dax function that returns one column or a list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 03:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-add-one-more-condition-on-this-measure/m-p/4243973#M168027</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-10-16T03:09:56Z</dc:date>
    </item>
  </channel>
</rss>

