<?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: Selected value on Dax in switch in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089377#M162304</link>
    <description>&lt;P&gt;Hello&lt;BR /&gt;thank you for your answers and your time&lt;/P&gt;&lt;P&gt;in fact the title does not correspond to the result but the error is correct, I have written incorrectly and never changed the title but I must accumulate the days worked.&lt;/P&gt;&lt;P&gt;Your function code saves me the intermediate calculation if I use fixed data for ([Max Boxes Value])&lt;/P&gt;&lt;P&gt;but unfortunately does not solve my problem.&lt;/P&gt;&lt;P&gt;if I use ([Max Box Value]) which is variable data entered from the max box segment it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Segement&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;</description>
    <pubDate>Thu, 08 Aug 2024 13:45:39 GMT</pubDate>
    <dc:creator>Elglouton</dc:creator>
    <dc:date>2024-08-08T13:45:39Z</dc:date>
    <item>
      <title>Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4084448#M162115</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the value captured by the Selectedvalue function as a variable to perform standard calculations, it works perfectly, but I wanted to embed it in a switch and the function returned the alternatResult.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;parameter table&lt;/U&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Boites Max =&lt;/SPAN&gt; &lt;SPAN&gt;GENERATESERIES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;500&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;500000&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;U&gt;Value&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Valeur Boites Max =&lt;/SPAN&gt; &lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Boites Max'&lt;/SPAN&gt;&lt;SPAN&gt;[Boites Max]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;U&gt;SWITCH fonction&lt;/U&gt;&lt;/DIV&gt;&lt;DIV&gt;BoiteJourPrev_L1 = SWITCH (&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T_DATE_[JoursVacances],&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;False,[Valeur Boites Max],0&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/DIV&gt;&lt;DIV&gt;Same with&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BoiteCumulPrev_L1M2 =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TOTALMTD&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;[Valeur Boites Max]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;T_DATE_&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;T_DATE_&lt;/SPAN&gt;&lt;SPAN&gt;[JoursVacances]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;False&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;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I use this measure to write the value to the table if the date is worked on&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Aug 2024 14:26:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4084448#M162115</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-06T14:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4084894#M162132</link>
      <description>&lt;P&gt;Hi Elglouton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's unclear to me from your measure syntax what you're trying to accomplish. For example, your&amp;nbsp;&lt;SPAN&gt;BoiteJourPrev_L1 measure looks like it's missing something and doesn't make sense logically. Check out &lt;A href="https://dax.guide/switch/" target="_self"&gt;this documentation on SWITCH&lt;/A&gt; and see if it helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you're still having trouble, please explain in words what you're actually trying to calculate in your two measures.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 18:05:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4084894#M162132</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-06T18:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4085819#M162160</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;thank you for your reply.&lt;BR /&gt;In my company we make boxes and we have a minimum quantity of boxes to produce per day to be in the forecast. I monitor this via a monthly graph which compares the boxes to be made with the boxes made.&lt;BR /&gt;But depending on the forecast this quantity changes from month to month and I would like to be able to use a segment so that the report users can change it easily.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I have a segment&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;and I want to use the selected value of this segment&lt;BR /&gt;Valeur Boites Max = SELECTEDVALUE('Boites Max'[Boites Max],0)&lt;/P&gt;&lt;P&gt;to make a monthly accumulation only of the days worked which are given by JoursVacances=True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't managed to do it directly, so I'm going through an intermediary.&lt;/P&gt;&lt;P&gt;BoiteJourPrev_L1 = SWITCH (&lt;BR /&gt;T_DATE_[JoursVacances],&lt;BR /&gt;False,[Valeur Boites Max],0&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;then I do my accumulation&lt;/P&gt;&lt;P&gt;BoiteCumulPrev_L1M =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;TOTALMTD(&lt;BR /&gt;sum(T_DATE_[BoiteJourPrev_L1]),T_DATE_[Date],T_DATE_[JoursVacances]=TRUE())&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;When I use it in simple calculations it works and I get back the value of the segment but when I want to integrate it in BoxDayPrev_L1 the calculation works but with the value&amp;nbsp;&lt;SPAN&gt;alternatResult of SELECTEDVALUE()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is clearer&lt;BR /&gt;I'm new to PWBi and I'm probably not using the different functions in the right way and I apologise for that.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 05:26:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4085819#M162160</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-07T05:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4086781#M162214</link>
      <description>&lt;P&gt;Hi Elglouton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for elaborating. I think I understand now. Can you also share a screenshot of your data model? I have an idea of what you need but it depends on your tables and relationships.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:11:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4086781#M162214</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-07T13:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4086810#M162217</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;perfect if it's easier to understand...&lt;BR /&gt;All is in the same table here attached a screen hoping that it is enough&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;</description>
      <pubDate>Wed, 07 Aug 2024 13:25:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4086810#M162217</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-07T13:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089289#M162300</link>
      <description>&lt;P&gt;Elglouton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, please try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;BoiteCumulPrev_L1M =
VAR NumDays =
CALCULATE (
    COUNTROWS ( VALUES ( T_DATE_[Date] ) ), -- counting the number of days
    T_DATE_[JoursVacances] = TRUE(),        -- where JoursVacances is True
    DATESMTD ( T_DATE_[Date] )              -- and days are in month to date
)
VAR Result = NumDays * [Valeur Boites Max]  -- multiplying number of days by your selected value

RETURN Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No need for the other intermediary measure, unless you want to reuse it for other measures as well. (I also think based on your screenshots that you meant that&amp;nbsp;&lt;SPAN&gt;T_DATE_&lt;/SPAN&gt;&lt;SPAN&gt;[JoursVacances] should be TRUE? It's confusing because the screenshot is saying vacation days are the ones that you're assigning the 7,500. Either T_DATE_[JoursVacances] should be TRUE or the True/False in the screenshot is backwards - or I've misunderstood that part too. :D)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;----------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on &lt;A href="https://www.upwork.com/freelancers/~01bc08c63d83566d45" target="_blank"&gt;Upwork&lt;/A&gt; or DM me directly on here! I would love to clear up your Power BI headaches.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 13:10:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089289#M162300</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-08T13:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089377#M162304</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;thank you for your answers and your time&lt;/P&gt;&lt;P&gt;in fact the title does not correspond to the result but the error is correct, I have written incorrectly and never changed the title but I must accumulate the days worked.&lt;/P&gt;&lt;P&gt;Your function code saves me the intermediate calculation if I use fixed data for ([Max Boxes Value])&lt;/P&gt;&lt;P&gt;but unfortunately does not solve my problem.&lt;/P&gt;&lt;P&gt;if I use ([Max Box Value]) which is variable data entered from the max box segment it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Segement&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;</description>
      <pubDate>Thu, 08 Aug 2024 13:45:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089377#M162304</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-08T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089848#M162326</link>
      <description>&lt;P&gt;Elglouton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My measure should be using the parameter value you're showing in the second screenshot.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 17:43:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4089848#M162326</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-08T17:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4091078#M162362</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a link to a simplified file&amp;nbsp;&lt;A href="https://we.tl/t-OOCQS1WWbW" target="_blank" rel="noopener"&gt;Fichier simplifié&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the value taken into account is the default value of the segment but not the value entered in the segment.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 07:49:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4091078#M162362</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-09T07:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4092611#M162410</link>
      <description>&lt;P&gt;Elglouton,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ah, it looks like the issue is you added it as a calculated column. It should be a measure.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;----------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on &lt;A href="https://www.upwork.com/freelancers/~01bc08c63d83566d45" target="_blank"&gt;Upwork&lt;/A&gt; or DM me directly on here! I would love to clear up your Power BI headaches.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:38:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4092611#M162410</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-09T20:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4094987#M162510</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Halala, in fact, it was that simple. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I didn't think I could make a graph with a measure because for me it's a unique value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry for the time you spent on this topic and thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 09:26:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4094987#M162510</guid>
      <dc:creator>Elglouton</dc:creator>
      <dc:date>2024-08-12T09:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Selected value on Dax in switch</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4095656#M162529</link>
      <description>&lt;P&gt;You're welcome, Elglouton. That's what we're here for! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the update.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 14:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Selected-value-on-Dax-in-switch/m-p/4095656#M162529</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2024-08-12T14:22:29Z</dc:date>
    </item>
  </channel>
</rss>

