<?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: Comparing values from 2 different selections in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/702810#M10504</link>
    <description>&lt;P&gt;So the first part of your requirement you could just do with a single slicer on Product that is set to allow multiple selections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Calculating the variance of a multi-select is a bit more involved, but not impossible (see the table on the right above). I did this with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Variance = 
var _selectedProducts = ALLSELECTED(Table1[Product])
var _countSelected = COUNTROWS(_selectedProducts)
var _prod1 = MINX(_selectedProducts,[Product])
var _prod2 = MAXX(_selectedProducts,[Product])
var _prod1Cost = CALCULATE(sum(Table1[Cost]), Table1[Product] = _prod1)
var _prod2Cost = CALCULATE(sum(Table1[Cost]), Table1[Product] = _prod2)
var _result = IF(_countSelected = 2 &amp;amp;&amp;amp; SELECTEDVALUE(Table1[Product]) = _prod1, _prod2Cost - _prod1Cost)
RETURN _result&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 May 2019 23:41:52 GMT</pubDate>
    <dc:creator>d_gosbell</dc:creator>
    <dc:date>2019-05-29T23:41:52Z</dc:date>
    <item>
      <title>Comparing values from 2 different selections</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/702664#M10500</link>
      <description>&lt;P&gt;I have a table with the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product, Date, Cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to have two slicers showing product. User can select a product from each slicer and I need to compare the cost of the two products by date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oil&amp;nbsp; 1/1/2019&amp;nbsp; 2.00&lt;/P&gt;&lt;P&gt;Gas 1/1/2019&amp;nbsp; 1.50&lt;/P&gt;&lt;P&gt;Tea&amp;nbsp; 1/1/2019&amp;nbsp; 0.50&lt;/P&gt;&lt;P&gt;Oil&amp;nbsp; 2/1/2019&amp;nbsp; 2.10&lt;/P&gt;&lt;P&gt;Gas 2/1/2019&amp;nbsp; 1.60&lt;/P&gt;&lt;P&gt;Tea&amp;nbsp; 2/1/2019&amp;nbsp; 0.60&lt;/P&gt;&lt;P&gt;Oil&amp;nbsp; 3/1/2019&amp;nbsp; 2.30&lt;/P&gt;&lt;P&gt;Gas 3/1/2019&amp;nbsp; 1.90&lt;/P&gt;&lt;P&gt;Tea&amp;nbsp; 3/1/2019&amp;nbsp; 1.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want two slicers both showing Oil, Gas and Tea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If user selects say Oil from one and Gas from the other, then output Graph should show&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dates as the X Coordinate, Price as the Y coordinate and bars for Oil and Gas for each date. I would also like to be able to calculate the variance between Oil price and Gas price for each date.&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>Wed, 29 May 2019 18:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/702664#M10500</guid>
      <dc:creator>Raymo3u99</dc:creator>
      <dc:date>2019-05-29T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values from 2 different selections</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/702810#M10504</link>
      <description>&lt;P&gt;So the first part of your requirement you could just do with a single slicer on Product that is set to allow multiple selections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Calculating the variance of a multi-select is a bit more involved, but not impossible (see the table on the right above). I did this with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Variance = 
var _selectedProducts = ALLSELECTED(Table1[Product])
var _countSelected = COUNTROWS(_selectedProducts)
var _prod1 = MINX(_selectedProducts,[Product])
var _prod2 = MAXX(_selectedProducts,[Product])
var _prod1Cost = CALCULATE(sum(Table1[Cost]), Table1[Product] = _prod1)
var _prod2Cost = CALCULATE(sum(Table1[Cost]), Table1[Product] = _prod2)
var _result = IF(_countSelected = 2 &amp;amp;&amp;amp; SELECTEDVALUE(Table1[Product]) = _prod1, _prod2Cost - _prod1Cost)
RETURN _result&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 23:41:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/702810#M10504</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2019-05-29T23:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values from 2 different selections</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/703553#M10509</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="109790" data-lia-user-login="d_gosbell" class="lia-mention lia-mention-user"&gt;d_gosbell&lt;/a&gt;&amp;nbsp; Thanks for the solution. This worked for me. The requirement was to have two slicers - From Product and To Product. So I created two Distinct(product) tables and then created slicers using those table. I had to then tweat your variance code a little.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 15:55:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Comparing-values-from-2-different-selections/m-p/703553#M10509</guid>
      <dc:creator>Raymo3u99</dc:creator>
      <dc:date>2019-05-30T15:55:00Z</dc:date>
    </item>
  </channel>
</rss>

