<?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 Measure depending on filter selected in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Measure-depending-on-filter-selected/m-p/3124650#M41681</link>
    <description>&lt;P&gt;I have a filter selecttion (Prior Year, Current Year)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have calculated the measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure_sale_2021 = 2021_sale&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceSales_USD])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceDate]) = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())-2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure_Sale-2022 = 2022_sale&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceSales_USD])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceDate]) = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())-1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure_Sale_2023 = 2023_sale&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceSales_USD])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceDate]) = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For filter Prior Year&amp;nbsp; &amp;nbsp; &amp;nbsp; Show Sale for Year 2021 as LY , Sale for Year 2022 as CY&lt;/P&gt;&lt;P&gt;For filter Current Year&amp;nbsp; show sale for Year 2022 as LY,&amp;nbsp; Sale for Year 2023&amp;nbsp; as CY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a measure calculated&lt;/P&gt;&lt;P&gt;CY =&amp;nbsp;SWITCH(VALUES('Date Filter'[FiscalDate Selection]),"PriorYear",[2022_sale],[2023_sale])&amp;nbsp;&lt;/P&gt;&lt;P&gt;LY =&amp;nbsp;SWITCH(VALUES('Date Filter'[FiscalDate Selection]),"PriorYear",[2021_sale],[2022_sale])&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works in a table where I have&lt;/P&gt;&lt;P&gt;Customer num, Cust name and Sale measure CY and LY&amp;nbsp;&lt;/P&gt;&lt;P&gt;doenot work when the table has&amp;nbsp;&lt;/P&gt;&lt;P&gt;Customer NUm, Cust Name, Product num, product Name CY and LY measure&lt;/P&gt;&lt;P&gt;gives me error&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 16:44:27 GMT</pubDate>
    <dc:creator>karti1507</dc:creator>
    <dc:date>2023-03-10T16:44:27Z</dc:date>
    <item>
      <title>Measure depending on filter selected</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Measure-depending-on-filter-selected/m-p/3124650#M41681</link>
      <description>&lt;P&gt;I have a filter selecttion (Prior Year, Current Year)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have calculated the measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure_sale_2021 = 2021_sale&amp;nbsp;&lt;/P&gt;&lt;P&gt;(&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceSales_USD])&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(FACT_INVOICE[InvoiceDate]) = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&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&lt;P&gt;For filter Prior Year&amp;nbsp; &amp;nbsp; &amp;nbsp; Show Sale for Year 2021 as LY , Sale for Year 2022 as CY&lt;/P&gt;&lt;P&gt;For filter Current Year&amp;nbsp; show sale for Year 2022 as LY,&amp;nbsp; Sale for Year 2023&amp;nbsp; as CY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a measure calculated&lt;/P&gt;&lt;P&gt;CY =&amp;nbsp;SWITCH(VALUES('Date Filter'[FiscalDate Selection]),"PriorYear",[2022_sale],[2023_sale])&amp;nbsp;&lt;/P&gt;&lt;P&gt;LY =&amp;nbsp;SWITCH(VALUES('Date Filter'[FiscalDate Selection]),"PriorYear",[2021_sale],[2022_sale])&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works in a table where I have&lt;/P&gt;&lt;P&gt;Customer num, Cust name and Sale measure CY and LY&amp;nbsp;&lt;/P&gt;&lt;P&gt;doenot work when the table has&amp;nbsp;&lt;/P&gt;&lt;P&gt;Customer NUm, Cust Name, Product num, product Name CY and LY measure&lt;/P&gt;&lt;P&gt;gives me error&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 16:44:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Measure-depending-on-filter-selected/m-p/3124650#M41681</guid>
      <dc:creator>karti1507</dc:creator>
      <dc:date>2023-03-10T16:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Measure depending on filter selected</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Measure-depending-on-filter-selected/m-p/3126771#M41695</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="527648" data-lia-user-login="karti1507" class="lia-mention lia-mention-user"&gt;karti1507&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to the error message, it seems the returned data of visual exceed the maximum&amp;nbsp;allowed size of '1000000' rows when you also apply the field [&lt;SPAN&gt;Product num&lt;/SPAN&gt;] and [&lt;SPAN&gt;product Name&lt;/SPAN&gt;] onto the visual. And there is&amp;nbsp;&lt;SPAN&gt;a one-million row limit for data returned from cloud data sources with DirectQuery, which are any data sources that aren't on-premises. Please find the details in the below documentation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery#one-million-row-limit" target="_self"&gt; One-million row limit&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can consider to create another two measures similar as below to replace&amp;nbsp;the field [&lt;SPAN&gt;Product num&lt;/SPAN&gt;] and [&lt;SPAN&gt;product Name&lt;/SPAN&gt;] using the function &lt;A href="https://learn.microsoft.com/en-us/dax/concatenatex-function-dax" target="_self"&gt;CONCATENATEX&lt;/A&gt;, it will return less rows.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://radacad.com/concatenatex-in-power-bi-and-dax-concatenate-values-of-a-column" target="_self"&gt;ConcatenateX in Power BI and DAX: Concatenate Values of a Column&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure1 =
VAR _selcustnum =
    SELECTEDVALUE ( 'Table'[Customer Num] )
RETURN
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[Customer Num] = _selcustnum ),
        'Table'[Product num],
        ","
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure2 =
VAR _selcustnum =
    SELECTEDVALUE ( 'Table'[Customer Num] )
RETURN
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[Customer Num] = _selcustnum ),
        'Table'[Product name],
        ","
    )&lt;/LI-CODE&gt;
&lt;P&gt;Finally, you will get the result similar as below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 03:31:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Measure-depending-on-filter-selected/m-p/3126771#M41695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T03:31:12Z</dc:date>
    </item>
  </channel>
</rss>

