<?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: How to make a table in runtime, that contains several measures, and receives params from visuals in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2189693#M51155</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="233537" data-lia-user-login="szabofe" class="lia-mention lia-mention-user"&gt;szabofe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to show the result into a table visual, here is a workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my understanding, only "B2" is dynamic and&amp;nbsp;'_QuantityMeasures'[ElectricityConsumption (kWh)] is a measure. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, just use "enter data" to create a table like so:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, create a measure like so:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;B. Amount of energy used =
VAR SelYear =
    SELECTEDVALUE ( 'DateTable'[Year], 2021 )
VAR B1 = 0
VAR B2 =
    CALCULATE (
        '_QuantityMeasures'[ElectricityConsumption (kWh)],
        'DateTable'[Year] = SelYear )
    )
VAR B3 = 0
RETURN
    SWITCH ( MAX ( 'Table'[C. Code] ), 1, B1, 2, B2, 3, B3 )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And put "C. Code", "A. Name of energy carrier" and "B. Amount of energy used". The screenshot below is just a sample.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2021 08:06:17 GMT</pubDate>
    <dc:creator>Icey</dc:creator>
    <dc:date>2021-11-15T08:06:17Z</dc:date>
    <item>
      <title>How to make a table in runtime, that contains several measures, and receives params from visuals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170168#M50377</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to construct a table in a given format. It is given by the national energy office.&lt;BR /&gt;My aproach to resolve the problem:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EnergyStatTable = 
VAR SelYear = SELECTEDVALUE('DateTable'[Year], 2021)
VAR B1 = 0
VAR B2 = 
    CALCULATE(
        '_QuantityMeasures'[ElectricityConsumption (kWh)], 
        FILTER('DateTable', [Year] = SelYear)
    ) 
VAR B3 = 0
RETURN 
    SELECTCOLUMNS(
        {
            (1, "self-generated electricity", B1), 
            (2, "bought electricity", B2), 
            (3, "derived heat", B3)
        }, 
        "C. Code", [Value1], 
        "A. Name of energy carrier", [Value2], 
        "B. Amount of energy used", [Value3]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem:&lt;/P&gt;&lt;P&gt;It is working when I am using constant "VAR SelYear = 2020".&lt;BR /&gt;I suppose the table is evaluated before the visual loads in.&lt;BR /&gt;&lt;BR /&gt;Could someone give me directions?&lt;BR /&gt;Whitch is the best practice situations like this?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;F.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 09:03:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170168#M50377</guid>
      <dc:creator>szabofe</dc:creator>
      <dc:date>2021-11-03T09:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a table in runtime, that contains several measures, and receives params from visuals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170355#M50383</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="233537" data-lia-user-login="szabofe" class="lia-mention lia-mention-user"&gt;szabofe&lt;/a&gt; , You can not use selected values/slicer values in a calculated table. &lt;/P&gt;
&lt;P&gt;You can only use that as var in measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then you can use sumx, minx etc to get final value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 09:55:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170355#M50383</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-03T09:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a table in runtime, that contains several measures, and receives params from visuals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170483#M50388</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;for the quick answer.&lt;BR /&gt;As I understand I can not make this table dynamic depending on a slicer.&lt;BR /&gt;The table collects heterogen measures. How can I make the user able to chose a year?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Nov 2021 11:04:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2170483#M50388</guid>
      <dc:creator>szabofe</dc:creator>
      <dc:date>2021-11-03T11:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a table in runtime, that contains several measures, and receives params from visuals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2189693#M51155</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="233537" data-lia-user-login="szabofe" class="lia-mention lia-mention-user"&gt;szabofe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to show the result into a table visual, here is a workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my understanding, only "B2" is dynamic and&amp;nbsp;'_QuantityMeasures'[ElectricityConsumption (kWh)] is a measure. Right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, just use "enter data" to create a table like so:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, create a measure like so:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;B. Amount of energy used =
VAR SelYear =
    SELECTEDVALUE ( 'DateTable'[Year], 2021 )
VAR B1 = 0
VAR B2 =
    CALCULATE (
        '_QuantityMeasures'[ElectricityConsumption (kWh)],
        'DateTable'[Year] = SelYear )
    )
VAR B3 = 0
RETURN
    SWITCH ( MAX ( 'Table'[C. Code] ), 1, B1, 2, B2, 3, B3 )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And put "C. Code", "A. Name of energy carrier" and "B. Amount of energy used". The screenshot below is just a sample.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 08:06:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2189693#M51155</guid>
      <dc:creator>Icey</dc:creator>
      <dc:date>2021-11-15T08:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a table in runtime, that contains several measures, and receives params from visuals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2219969#M52655</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="164362" data-lia-user-login="Icey" class="lia-mention lia-mention-user"&gt;Icey&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;It is I was looking for.&lt;BR /&gt;Great soulution.&lt;BR /&gt;&lt;BR /&gt;Regards,&amp;nbsp;&lt;BR /&gt;F.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 12:09:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-make-a-table-in-runtime-that-contains-several-measures/m-p/2219969#M52655</guid>
      <dc:creator>szabofe</dc:creator>
      <dc:date>2021-12-03T12:09:43Z</dc:date>
    </item>
  </channel>
</rss>

