<?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: Sorting stacked bar chart by total not correct for calculated measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269628#M121128</link>
    <description>&lt;P&gt;Using your PBIX file, I created a similar measure. It messes up the sorting with your data too.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Attaching the pbix file with the measure:&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AoIqh2N1X4o2jFv0Zre2BuP5L6zy?e=q0fvKx" target="_blank"&gt;kkashiv.pbix&lt;/A&gt;&lt;BR /&gt;Is it because of the DAX expression?&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 04:29:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-06-06T04:29:06Z</dc:date>
    <item>
      <title>Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269449#M121117</link>
      <description>&lt;P&gt;PowerBI novice here. I have a measure named '&lt;STRONG&gt;Measure_2&lt;/STRONG&gt;' that displays this information where commodity( Electric, Natural Gas, Steam, etc) is the legend for stacked bar chart.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the data in a tabular format.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I would like to sort this by the &lt;STRONG&gt;total of all columns&lt;/STRONG&gt; for &lt;STRONG&gt;individual Building&lt;/STRONG&gt;. Basically keep the longest bar first.&amp;nbsp;&lt;BR /&gt;I have selected the sort by Measure 2 in descending order&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However this doesnt sort the stacked bar chart in the correct order even though the totals above each bar is correct. Is there a way to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 04:09:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269449#M121117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-07T04:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269598#M121126</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbixfile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 03:24:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269598#M121126</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-06-06T03:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269619#M121127</link>
      <description>&lt;P&gt;Thanks for replying. Your data model is exactly similar to mine. The only difference is that I am using a measure called 'Measure_2' that utilizes another measure 'Bill_line_items_value' and converts values to the same unit.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;DAX expression of the measure:&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;If I use the original measure 'Bill_line_item_value', it sorts the bars correctly:-&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The sorting is failing for the new measure 'Measure_2' I created for standardizing the values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 03:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269619#M121127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-06T03:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269628#M121128</link>
      <description>&lt;P&gt;Using your PBIX file, I created a similar measure. It messes up the sorting with your data too.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Attaching the pbix file with the measure:&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AoIqh2N1X4o2jFv0Zre2BuP5L6zy?e=q0fvKx" target="_blank"&gt;kkashiv.pbix&lt;/A&gt;&lt;BR /&gt;Is it because of the DAX expression?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 04:29:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3269628#M121128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-06T04:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271709#M121288</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please kindly check if the below measure works as expected with showing the correct numbers.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_2 =
SUMX (
    SUMMARIZE ( Data, Buildings[Buildings], Commodity[Commodity] ),
    IF (
        Commodity[Commodity] = "Electric",
        [Value measure:] * 3.412,
        IF (
            Commodity[Commodity] = "Natural Gas",
            [Value measure:] * 100,
            IF (
                Commodity[Commodity] = "Steam",
                [Value measure:] * 1194,
                IF (
                    Commodity[Commodity] = "Chilled Water",
                    Data[Value measure:] * 12,
                    [Value measure:]
                )
            )
        )
    )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Jun 2023 03:10:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271709#M121288</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-06-07T03:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271719#M121290</link>
      <description>&lt;P&gt;Yes this works. Thank you so much. I would like to understand the difference in the DAX expression. What exactly changed?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 03:15:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271719#M121290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-07T03:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting stacked bar chart by total not correct for calculated measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271726#M121293</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;It changed to produce the total number of each building. If you try to change the visualization to a table visualization, and if you see the Total Row in the visualization, two measures show different total number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think, the one you provided showed correct numbers in each row, however, it showed an incorrect number in the total row.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 03:23:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-stacked-bar-chart-by-total-not-correct-for-calculated/m-p/3271726#M121293</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-06-07T03:23:10Z</dc:date>
    </item>
  </channel>
</rss>

