<?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: Lost Customers, &amp;quot;dynamic measures&amp;quot; in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3599543#M139092</link>
    <description>&lt;P&gt;&lt;FONT&gt;Buenos días,&lt;BR /&gt;Gracias de nuevo por su respuesta. La solución que propones no funciona. A continuación, te mostraré los resultados proporcionados por la solución y cuáles son los resultados deseados:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Te agradecería mucho que siguieras ayudándome.&lt;BR /&gt;Gracias de antemano,&lt;/P&gt;</description>
    <pubDate>Sat, 23 Dec 2023 09:11:46 GMT</pubDate>
    <dc:creator>joseluis1969240</dc:creator>
    <dc:date>2023-12-23T09:11:46Z</dc:date>
    <item>
      <title>Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598070#M139032</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good morning,&lt;BR /&gt;I'm trying to create two 'dynamic' measures in DAX that provide me with the number of lost customers and the amount of sales those customers had. In my case, lost customers are the ones who haven't had any sales in either the current fiscal year or the two previous fiscal years. The measure I'm using to calculate the sales of lost customers is as follows:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I use this measure without applying any date filter (fiscal year), the measure works fine. However, if I apply a filter by fiscal year in the pivot table, the data appears blank. What I want to achieve is for the measure to be dynamic, meaning if I select fiscal year 2024 in the pivot table, the result should be the lost customers in fiscal year 2024. If I select fiscal year 2023, the results should be the lost customers in fiscal year 2023...&lt;BR /&gt;Can you please help me?&lt;BR /&gt;Thank you very much in advance,&lt;BR /&gt;Kind Regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 05:27:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598070#M139032</guid>
      <dc:creator>joseluis1969240</dc:creator>
      <dc:date>2023-12-22T05:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598509#M139043</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="658644" data-lia-user-login="joseluis1969240" class="lia-mention lia-mention-user"&gt;joseluis1969240&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales loss customer=
 Var yearmax= selectedvalue (calendario [fiscal_year])
 Var result= sumx(
        All(ventas[customer Account]),
   Var sales3yrs = Calculate ( [sales], calendario [fiscal_year]&amp;lt;= yearmax,
        calendario [fiscal_year]&amp;gt;= yearmax-2)
  Var salesbefore3year = 
      Calculate ([sales], calendario [fiscal_year]&amp;lt; yearmax-2)
Return
If(isblank(sales3yrs), salesbefore3year, sales3yrs)
)
 Return 
Result &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Dec 2023 09:15:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598509#M139043</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-12-22T09:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598735#M139049</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good morning:&lt;BR /&gt;Firstly, thank you for your response. I can't use the measurement you mentioned because the SELECTEDVALUE function doesn't exist in POWER PIVOT. Is it possible to modify the measurement using another function?&lt;BR /&gt;Thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 12:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598735#M139049</guid>
      <dc:creator>joseluis1969240</dc:creator>
      <dc:date>2023-12-22T12:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598746#M139052</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="658644" data-lia-user-login="joseluis1969240" class="lia-mention lia-mention-user"&gt;joseluis1969240&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to replace selectedvalue with below&lt;/P&gt;&lt;P&gt;Var yearmax= max (calendario [fiscal_year])&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2023 12:30:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3598746#M139052</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-12-22T12:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3599543#M139092</link>
      <description>&lt;P&gt;&lt;FONT&gt;Buenos días,&lt;BR /&gt;Gracias de nuevo por su respuesta. La solución que propones no funciona. A continuación, te mostraré los resultados proporcionados por la solución y cuáles son los resultados deseados:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Te agradecería mucho que siguieras ayudándome.&lt;BR /&gt;Gracias de antemano,&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2023 09:11:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3599543#M139092</guid>
      <dc:creator>joseluis1969240</dc:creator>
      <dc:date>2023-12-23T09:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3600559#M139124</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="658644" data-lia-user-login="joseluis1969240" class="lia-mention lia-mention-user"&gt;joseluis1969240&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I have created a simple sample, please refer to it to see if it helps you.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;value_2 = var _1=SELECTEDVALUE('fiscal year'[year])
var _2yearsbefore=_1-3
return
IF(_1=SELECTEDVALUE('Table'[year]),MAX('Table'[sales amount]),BLANK())&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;value_3= var _1=SELECTEDVALUE('fiscal year'[year])
var _2yearsbefore=_1-3
var _3=IF(_1=SELECTEDVALUE('Table'[year]),MAX('Table'[customer]),BLANK())
var _4=
IF(_2yearsbefore=SELECTEDVALUE('Table'[year]),CALCULATE(SUM('Table'[sales amount]),FILTER(ALL('Table'),'Table'[year]=_2yearsbefore&amp;amp;&amp;amp;'Table'[customer]=SELECTEDVALUE('Table'[customer]))),BLANK()
)
return _3&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure 4 = MAXX(FILTER(ALL('Table'),'Table'[customer]=SELECTEDVALUE('Table'[customer])),[value_3])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure 5 = var _1=SELECTEDVALUE('fiscal year'[year])
var _2yearsbefore=_1-3
var _4=
IF(_2yearsbefore=SELECTEDVALUE('Table'[year])&amp;amp;&amp;amp;[Measure 4]=BLANK(),CALCULATE(SUM('Table'[sales amount]),FILTER(ALL('Table'),'Table'[year]=_2yearsbefore&amp;amp;&amp;amp;'Table'[customer]=SELECTEDVALUE('Table'[customer]))),BLANK()
)
return _4&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Rongtie&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Dec 2023 02:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3600559#M139124</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-25T02:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customers, "dynamic measures"</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3605270#M139290</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good morning:&lt;BR /&gt;First of all, thank you for your response. &lt;STRONG&gt;I cannot test the solution because I am a Power Pivot user, and in Power Pivot, the SELECTEDVALUE function does not exist&lt;/STRONG&gt;. Could you please tell me &lt;STRONG&gt;how I could adapt the DAX code to work with a different function than SELECTEDVALUE&lt;/STRONG&gt;?&lt;BR /&gt;Thank you in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 10:44:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customers-quot-dynamic-measures-quot/m-p/3605270#M139290</guid>
      <dc:creator>joseluis1969240</dc:creator>
      <dc:date>2023-12-28T10:44:16Z</dc:date>
    </item>
  </channel>
</rss>

