<?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 Is it possible to use a dynamic value as legend? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3005156#M101653</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have my clustered column chart working just fine, with&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Rev&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Rev SamePeriodLastYear.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measures:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Rev is just a sum… and the other measure uses the function SAMEPERIODLASTYEAR.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my report I use the YEAR filter:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine, my issue is with my legends:&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;DIV class=""&gt;&lt;P&gt;I want to see as legend;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2023 2022&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(when 2023 is selected) and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2022 2021&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(when 2022 is selected). (or at least static/generic like "selected year" "previous year")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this even possible? The legend section doesn't have a 'function' option to make it dynamic&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2023 07:59:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-06T07:59:01Z</dc:date>
    <item>
      <title>Is it possible to use a dynamic value as legend?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3005156#M101653</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have my clustered column chart working just fine, with&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Rev&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Rev SamePeriodLastYear.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measures:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Rev is just a sum… and the other measure uses the function SAMEPERIODLASTYEAR.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my report I use the YEAR filter:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine, my issue is with my legends:&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;DIV class=""&gt;&lt;P&gt;I want to see as legend;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2023 2022&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(when 2023 is selected) and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;2022 2021&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(when 2022 is selected). (or at least static/generic like "selected year" "previous year")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this even possible? The legend section doesn't have a 'function' option to make it dynamic&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 07:59:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3005156#M101653</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-06T07:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a dynamic value as legend?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3005687#M101679</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , I doubt rename measure dynamically, What You can try is have a slicer on an independent table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Date1 is independent Date table, Date is joined with Table &lt;BR /&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date1),Date1[Year])&lt;BR /&gt;var _min = _max -1 &lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value]), filter('Date', 'Date'[Year] &amp;gt;=_min &amp;amp;&amp;amp; 'Date'[Year] &amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need of an Independent Date Table:&lt;A href="https://www.youtube.com/watch?v=44fGGmg9fHI" target="_blank"&gt;https://www.youtube.com/watch?v=44fGGmg9fHI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 12:38:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3005687#M101679</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-01-06T12:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a dynamic value as legend?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3008498#M101934</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I create a sample to have a test. In my sample, data is from 2020/01/01 to 2023/01/09. I suggest you to create an unrelated DimYear table to create the slicer. My data model is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rev = 
VAR _SELECT =
    SELECTEDVALUE ( SelectYear[Year] )
RETURN
    IF (
        SELECTEDVALUE ( DimDate[Year] )
            IN { _SELECT, _SELECT - 1 },
        SUM ( 'Table'[Value] )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Mon, 09 Jan 2023 09:08:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-it-possible-to-use-a-dynamic-value-as-legend/m-p/3008498#M101934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-09T09:08:39Z</dc:date>
    </item>
  </channel>
</rss>

