<?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: SELECTEDVALUE to CustomColumn in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SELECTEDVALUE-to-CustomColumn/m-p/1458636#M27483</link>
    <description>&lt;P&gt;I was able to figure this out, thanks to other contributors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;basically SELECTEDCALUE cannot be used for creating a Custom Column or even a even creating a table. It can only be used in a Measure.&lt;/P&gt;&lt;P&gt;So I created measures for all my facts and replaced them in the historic graphs of my report and it worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure =&lt;/P&gt;&lt;P&gt;var _currdt = SELECTEDVALUE ( User selected date)&lt;/P&gt;&lt;P&gt;var _Prvdt = DATE(YEar (_currdt), MONTH&amp;nbsp;(_currdt) -12, DAY(_currdt))&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE ( Aggregation_col,&lt;BR /&gt;hist_date &amp;gt;= _prvdt &amp;amp;&amp;amp; hist_date &amp;lt;= _currdt)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks guys&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 15:51:11 GMT</pubDate>
    <dc:creator>payyadi</dc:creator>
    <dc:date>2020-10-27T15:51:11Z</dc:date>
    <item>
      <title>SELECTEDVALUE to CustomColumn</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SELECTEDVALUE-to-CustomColumn/m-p/1458587#M27480</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;need help here,&lt;/P&gt;&lt;P&gt;I have a report with "&lt;EM&gt;&lt;STRONG&gt;user selected date&lt;/STRONG&gt;&lt;/EM&gt; graphs and &lt;EM&gt;&lt;STRONG&gt;historic&lt;/STRONG&gt;&lt;/EM&gt;(1year old data from user selected date) graphs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a date slicer for this,&lt;/P&gt;&lt;P&gt;&amp;gt; I want to capture user selected date&lt;/P&gt;&lt;P&gt;&amp;gt; create a custom column in the historic table(SQL Import) to calculate the difference in month and pick last 12months of data : &lt;EM&gt;&lt;STRONG&gt;DATEDIFF( Hist_date, SELECTEDVALUE(User_selected_date),MONTH) &amp;lt; =12&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&amp;gt; Historic graph uses this Hist_Date in the axis to show &lt;EM&gt;user_selected minus 12months&lt;/EM&gt; of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;SELECTEDVALUE(user_slected_date) is always NULL here&lt;/STRONG&gt;&lt;/EM&gt;, if I create a measure with SELECTEDVALUE(User_selected_date) and add that to card on report it shows what User has selected but doesnt work in the DATEDIFF/expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help how I can solve this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:15:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SELECTEDVALUE-to-CustomColumn/m-p/1458587#M27480</guid>
      <dc:creator>payyadi</dc:creator>
      <dc:date>2020-10-27T15:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTEDVALUE to CustomColumn</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SELECTEDVALUE-to-CustomColumn/m-p/1458636#M27483</link>
      <description>&lt;P&gt;I was able to figure this out, thanks to other contributors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;basically SELECTEDCALUE cannot be used for creating a Custom Column or even a even creating a table. It can only be used in a Measure.&lt;/P&gt;&lt;P&gt;So I created measures for all my facts and replaced them in the historic graphs of my report and it worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure =&lt;/P&gt;&lt;P&gt;var _currdt = SELECTEDVALUE ( User selected date)&lt;/P&gt;&lt;P&gt;var _Prvdt = DATE(YEar (_currdt), MONTH&amp;nbsp;(_currdt) -12, DAY(_currdt))&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATE ( Aggregation_col,&lt;BR /&gt;hist_date &amp;gt;= _prvdt &amp;amp;&amp;amp; hist_date &amp;lt;= _currdt)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks guys&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:51:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SELECTEDVALUE-to-CustomColumn/m-p/1458636#M27483</guid>
      <dc:creator>payyadi</dc:creator>
      <dc:date>2020-10-27T15:51:11Z</dc:date>
    </item>
  </channel>
</rss>

