<?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 Line Chart: Average of all Selected Lines during timestamp in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3220481#M42529</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to keep an average of all selected lines (during each timestamp) on my line chart. However, I don't think PowerBI allows me to keep this curve due to the way legends interact with the data. See below what I mean:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the legend:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the legend:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect, I want the bottom curve (without the legend) overlayed with the top image's curves. Note, the curve without the legend&amp;nbsp;&lt;EM&gt;will&lt;/EM&gt; shift when I select/deselect the various legend values. I want this line to overlay with all unique legend values, and average the selected legend values when specified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps describe my issue in enough depth.&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 16:23:22 GMT</pubDate>
    <dc:creator>josh122398</dc:creator>
    <dc:date>2023-05-04T16:23:22Z</dc:date>
    <item>
      <title>Line Chart: Average of all Selected Lines during timestamp</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3220481#M42529</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to keep an average of all selected lines (during each timestamp) on my line chart. However, I don't think PowerBI allows me to keep this curve due to the way legends interact with the data. See below what I mean:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the legend:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the legend:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect, I want the bottom curve (without the legend) overlayed with the top image's curves. Note, the curve without the legend&amp;nbsp;&lt;EM&gt;will&lt;/EM&gt; shift when I select/deselect the various legend values. I want this line to overlay with all unique legend values, and average the selected legend values when specified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps describe my issue in enough depth.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 16:23:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3220481#M42529</guid>
      <dc:creator>josh122398</dc:creator>
      <dc:date>2023-05-04T16:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Line Chart: Average of all Selected Lines during timestamp</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3223923#M42555</link>
      <description>&lt;P&gt;If this is important to you please consider voting for an existing idea or raising a new one at &lt;A href="https://ideas.powerbi.com" target="_blank"&gt;https://ideas.powerbi.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 00:48:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3223923#M42555</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-05-08T00:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Line Chart: Average of all Selected Lines during timestamp</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3254934#M42841</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="552030" data-lia-user-login="josh122398" class="lia-mention lia-mention-user"&gt;josh122398&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First create a new table like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Vc6xDcAwCETRXahdGDBJ2iRjWOy/hk1ko0txzZO+oHeSKkKF7jmu5CXlCTlQ3jmxLboqZZSo5CdRcUpblTWUqFRQorK8bvvDE+WrGkpUepH7AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Legend = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Legend", type text}, {"Value", Int64.Type}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Legend"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Other Columns"),
    #"Added Custom" = Table.AddColumn(#"Removed Duplicates", "Custom", each {_[Legend],"Average"}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then build relationship between the two tables:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create a slicer:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apply the measure to the line chart:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _a =
    ALLSELECTED ( 'Table'[Legend] )
RETURN
    IF (
        SELECTEDVALUE ( Legend[Custom] ) = "Average",
        CALCULATE (
            AVERAGE ( 'Table'[Value] ),
            FILTER (
                ALL ( 'Table' ),
                [Legend]
                    IN _a
                        &amp;amp;&amp;amp; [Year] = SELECTEDVALUE ( 'Table'[Year] )
            )
        ),
        SUM ( 'Table'[Value] )
    )
Measure =
VAR _a =
    ALLSELECTED ( 'Table'[Legend] )
RETURN
    IF (
        SELECTEDVALUE ( Legend[Custom] ) = "Average",
        CALCULATE (
            AVERAGE ( 'Table'[Value] ),
            FILTER (
                ALL ( 'Table' ),
                [Legend]
                    IN _a
                        &amp;amp;&amp;amp; [Year] = SELECTEDVALUE ( 'Table'[Year] )
            )
        ),
        SUM ( 'Table'[Value] )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final output:&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;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 08:56:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Line-Chart-Average-of-all-Selected-Lines-during-timestamp/m-p/3254934#M42841</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2023-05-26T08:56:53Z</dc:date>
    </item>
  </channel>
</rss>

