<?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: Trend in the filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4076207#M161848</link>
    <description>&lt;P&gt;thank you, but:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;the solution filter only months when it is a increase, but for example :&lt;BR /&gt;- 2023-01 increase&lt;BR /&gt;- 2023-02 increase&lt;BR /&gt;- 2023-03 decrease&lt;BR /&gt;- 2023-04&amp;nbsp;increase&lt;BR /&gt;so the overall trend is increasing and if the user choose increasing and time period from 2023-01 to 2023-04 , the report should give those months with the clients (not only 01,02,04)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 07:17:32 GMT</pubDate>
    <dc:creator>lukzas</dc:creator>
    <dc:date>2024-08-05T07:17:32Z</dc:date>
    <item>
      <title>Trend in the filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4073771#M161743</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I can't solve the problem problem:&lt;/P&gt;&lt;P&gt;I have a table in PowerBI:&lt;/P&gt;&lt;P&gt;Month (YYYY-MM)&lt;BR /&gt;Year (YYYY)&lt;BR /&gt;Client&lt;/P&gt;&lt;P&gt;Sale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a filter named Trend (increasing,&amp;nbsp;decreasing,&amp;nbsp;steady). Scenario:&lt;/P&gt;&lt;P&gt;User choose the time interval in the filter Year or Month and choose Increasing in the Trend.&lt;/P&gt;&lt;P&gt;Report should choose the Clients with increasing Sale in the chosen time.&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;The difficulty is the lack of a standard date table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have access to this table in sqlserver so maybe some transformation in the source would helps..&lt;/P&gt;&lt;P&gt;Thank you for the ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 14:23:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4073771#M161743</guid>
      <dc:creator>lukzas</dc:creator>
      <dc:date>2024-08-01T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trend in the filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4074630#M161775</link>
      <description>&lt;P&gt;Yes, you can achieve this in Power BI, even without a standard date table. Here’s a step-by-step approach to create a filter named "Trend" that allows users to choose "Increasing," "Decreasing," or "Steady" and shows the clients with the corresponding sales trend:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create Measures for Trend Calculation&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;You’ll need to create measures to determine if sales are increasing, decreasing, or steady over the selected time period.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example Measures:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Total Sales Measure&lt;/STRONG&gt;:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;TotalSales = SUM('YourTable'[Sale])&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Previous Period Sales Measure&lt;/STRONG&gt;: For this measure, you will need to use PREVIOUSMONTH or PREVIOUSYEAR depending on whether you are working at a month or year level.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;PreviousPeriodSales =&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TotalSales],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEADD('YourTable'[Month], -1, MONTH)&amp;nbsp; // For monthly data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // DATEADD('YourTable'[Year], -1, YEAR)&amp;nbsp; // For yearly data&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Sales Trend Measure&lt;/STRONG&gt;: Determine the trend based on the comparison between the current period's sales and the previous period's sales.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;SalesTrend =&lt;/P&gt;&lt;P&gt;SWITCH(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRUE(),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TotalSales] &amp;gt; [PreviousPeriodSales], "Increasing",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TotalSales] &amp;lt; [PreviousPeriodSales], "Decreasing",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Steady"&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a Trend Filter&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Create a slicer to allow users to select the trend type.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a Table for Trend Options&lt;/STRONG&gt;: In Power BI Desktop, go to the Modeling tab, select "New Table," and enter the following DAX:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;TrendOptions =&lt;/P&gt;&lt;P&gt;DATATABLE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Trend", STRING,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { {"Increasing"}, {"Decreasing"}, {"Steady"} }&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Add the Trend Filter to the Report&lt;/STRONG&gt;: Drag the Trend column from the TrendOptions table into a slicer visual on your report.&lt;/LI&gt;&lt;/OL&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Filter Data Based on Selected Trend&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;To filter the data based on the selected trend, you need to apply a visual filter or create a calculated table based on the trend selection.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Using Visual Level Filters:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Add a Table or Matrix Visual&lt;/STRONG&gt;: Drag the Client field and TotalSales measure into a Table or Matrix visual.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Apply a Filter&lt;/STRONG&gt;: Use the SalesTrend measure created earlier in the visual level filters pane. Set it to show only items where SalesTrend matches the selected trend.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Using a Calculated Table (Alternative Approach):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You could also create a calculated table that filters clients based on the selected trend.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a Calculated Table&lt;/STRONG&gt;:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;FilteredClients =&lt;/P&gt;&lt;P&gt;VAR SelectedTrend = SELECTEDVALUE('TrendOptions'[Trend])&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'YourTable',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'YourTable'[Client],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TotalSales", [TotalSales],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "SalesTrend", [SalesTrend]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [SalesTrend] = SelectedTrend&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Use the Filtered Table in Your Report&lt;/STRONG&gt;: Use the FilteredClients table in your visuals to show only the clients with the selected sales trend.&lt;/LI&gt;&lt;/OL&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Update SQL Source (Optional)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you prefer to do transformations in SQL Server, you could pre-calculate some of these metrics and trends in your SQL queries or views to make it easier to work with in Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 01:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4074630#M161775</guid>
      <dc:creator>Shravan133</dc:creator>
      <dc:date>2024-08-02T01:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trend in the filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4075285#M161800</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661939" data-lia-user-login="lukzas" class="lia-mention lia-mention-user"&gt;lukzas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can create a date table by following the instructions here. &lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;When you create the basic Calendar table create a custom column for &lt;STRONG&gt;(YYYY-MM)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year/Month = FORMAT('Calendar'[Date], "YYYY-MM")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Many to Many Relationship from the new column above to the Month column in your table. Force the relationship so that Calendar filters your table. click on Cross Filter direction and choose the option I mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you want to create a trend, you need something to compare against a KPI? If you can provide some context and a range you want to measure against, we could use a similar measure below to calculate the last 3 months for example and compare it against the KPI&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 3 months template measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last 3 Months =
CALCULATE (
    [YourSalesMeasure],
    DATESINPERIOD ( 'Calendar'[Date], MAX ( 'DIM Date'[Date] ), -3, MONTH )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 07:07:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4075285#M161800</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-08-02T07:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trend in the filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4076207#M161848</link>
      <description>&lt;P&gt;thank you, but:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;the solution filter only months when it is a increase, but for example :&lt;BR /&gt;- 2023-01 increase&lt;BR /&gt;- 2023-02 increase&lt;BR /&gt;- 2023-03 decrease&lt;BR /&gt;- 2023-04&amp;nbsp;increase&lt;BR /&gt;so the overall trend is increasing and if the user choose increasing and time period from 2023-01 to 2023-04 , the report should give those months with the clients (not only 01,02,04)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 07:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4076207#M161848</guid>
      <dc:creator>lukzas</dc:creator>
      <dc:date>2024-08-05T07:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trend in the filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4079379#M161962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="661939" data-lia-user-login="lukzas" class="lia-mention lia-mention-user"&gt;lukzas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="558108" data-lia-user-login="Shravan133" class="lia-mention lia-mention-user"&gt;Shravan133&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="707963" data-lia-user-login="Joe_Barry" class="lia-mention lia-mention-user"&gt;Joe_Barry&lt;/a&gt;&amp;nbsp; for their quick replies. Did their replies solve your problem? If so, please mark helpful replies as solutions. If no,&amp;nbsp;please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 02:33:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-in-the-filter/m-p/4079379#M161962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-05T02:33:04Z</dc:date>
    </item>
  </channel>
</rss>

