<?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: Dynamic total sum of a column minimum in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542554#M136176</link>
    <description>&lt;P&gt;You should have a date dimesion in your model that includes a YearMonth or MonthYear column, then you could create the measure like this:&lt;BR /&gt;MinMonthlySales = SUMX(VALUES(dim_date[year_month]),CALCULATE(MIN(fact_table[sales])))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 13:51:14 GMT</pubDate>
    <dc:creator>sjoerdvn</dc:creator>
    <dc:date>2023-11-20T13:51:14Z</dc:date>
    <item>
      <title>Dynamic total sum of a column minimum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542165#M136145</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have created a matrix visual in my powerbi report, same as the demo created using Excel.&lt;BR /&gt;Instead of calculating the sum of the minimum formula's outputs, it's taking the minimum value of those values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I write a dax measure where i can apply the minimum function when an item description has been selected and calculating the sum of those values in the total section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the use case where I want to use this logic is that after grouping the sales for each month in the year 2023, I want to see the minimum sales, average sales, maximum sales.&lt;/P&gt;&lt;P&gt;The minimum function is extracting the total minimum of those months, and not the total for the minimum values of those year&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 10:24:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542165#M136145</guid>
      <dc:creator>RoadRunner2207</dc:creator>
      <dc:date>2023-11-20T10:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic total sum of a column minimum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542201#M136147</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To achieve the desired result in Power BI, you can create a DAX measure that calculates the sum of the minimum values for each item description when filtering by a specific condition (e.g., a selected year). Here's an example measure that you can use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TotalMinimumSales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(&lt;BR /&gt;VALUES('YourTable'[ItemDescription]),&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN('YourTable'[Sales]),&lt;BR /&gt;ALL('YourTable'[Month]),&lt;BR /&gt;'YourTable'[Year] = SELECTEDVALUE('YourTable'[Year])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a breakdown of the measure:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VALUES('YourTable'[ItemDescription]): This part creates a table of unique values in the 'ItemDescription' column.&lt;/LI&gt;&lt;LI&gt;CALCULATE(MIN('YourTable'[Sales]), ALL('YourTable'[Month]), 'YourTable'[Year] = SELECTEDVALUE('YourTable'[Year])): This part calculates the minimum sales for each 'ItemDescription' within the selected year, ignoring any filters on the 'Month' column.&lt;/LI&gt;&lt;LI&gt;SUMX(...) wraps the inner calculation to iterate over each 'ItemDescription' and calculate the sum of the minimum sales.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This measure should give you the total sum of the minimum sales for the selected year when you use it in your matrix visual. Replace 'YourTable', 'ItemDescription', 'Sales', 'Month', and 'Year' with the actual names of your table and columns.&lt;/P&gt;&lt;P&gt;Remember to adjust column and table names based on your data model. Additionally, be cautious about the context in which you use this measure, as it may behave differently depending on your report structure and user interactions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 10:38:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542201#M136147</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-20T10:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic total sum of a column minimum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542493#M136169</link>
      <description>&lt;P&gt;This solution has a missing step as even though in the use case example i have stated that I'll be using total of the minimum for the whole year, however, sometimes I will select 2 months (October/November) and get the total of their minimum values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 13:13:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542493#M136169</guid>
      <dc:creator>RoadRunner2207</dc:creator>
      <dc:date>2023-11-20T13:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic total sum of a column minimum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542554#M136176</link>
      <description>&lt;P&gt;You should have a date dimesion in your model that includes a YearMonth or MonthYear column, then you could create the measure like this:&lt;BR /&gt;MinMonthlySales = SUMX(VALUES(dim_date[year_month]),CALCULATE(MIN(fact_table[sales])))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 13:51:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3542554#M136176</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-11-20T13:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic total sum of a column minimum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3543771#M136235</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I understand the requirement better now. To achieve the flexibility of selecting specific months and getting the total of their minimum values, you can modify the DAX measure to consider the selected months in the filter context. Assuming you have a 'Month' column in your 'Sales' table, you can use the following modified DAX measure:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TotalMinimumSales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUMX(&lt;BR /&gt;VALUES('Sales'[ItemDescription]),&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN('Sales'[SalesAmount]),&lt;BR /&gt;ALL('Sales'[Month]) // Remove filters from 'Month' except those selected&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this modification, the ALL('Sales'[Month]) part removes all filters from the 'Month' column except the ones selected in the visual. This way, when you select specific months in your matrix visual, the measure will consider only those months for calculating the minimum sales amount.&lt;/P&gt;&lt;P&gt;Make sure to adjust the column and table names according to your actual data model. This measure should work in scenarios where you select specific months and want to calculate the total of their minimum values for the selected 'ItemDescription'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 05:26:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-total-sum-of-a-column-minimum/m-p/3543771#M136235</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-21T05:26:53Z</dc:date>
    </item>
  </channel>
</rss>

