<?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 DATATABLE code help in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798192#M4741</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm just getting started with DATATABLE and am wondering about the following scenario:&lt;/P&gt;&lt;P&gt;Column A has 4 rows&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Column B has 10 rows, multiple values for columns 3 (5) and 4 (3).&lt;/P&gt;&lt;P&gt;Is this doable with DATATABLE? Do I need Table Constructor instead? Here's what I have so far; I need multiple Gift Levels for my "Big" row...:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Gift Table = 
DATATABLE (
    "Gift Level Name", STRING,
    "Gift Level", STRING,
    "Gifts Needed", INTEGER,
    "Prospects Needed", INTEGER,
    "Dollars Needed", CURRENCY,
    "Cumulative Total", CURRENCY,
    {
        { "Biggest", "#####", #####, #####, #####, #####},
        { "Bigger", "#####", #####, #####, #####, ##### },
        { "Big", "#####", #####, #####, #####, #####}
    }
)&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Sep 2019 14:09:50 GMT</pubDate>
    <dc:creator>MarkPalmberg</dc:creator>
    <dc:date>2019-09-20T14:09:50Z</dc:date>
    <item>
      <title>DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798192#M4741</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm just getting started with DATATABLE and am wondering about the following scenario:&lt;/P&gt;&lt;P&gt;Column A has 4 rows&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;Column B has 10 rows, multiple values for columns 3 (5) and 4 (3).&lt;/P&gt;&lt;P&gt;Is this doable with DATATABLE? Do I need Table Constructor instead? Here's what I have so far; I need multiple Gift Levels for my "Big" row...:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Gift Table = 
DATATABLE (
    "Gift Level Name", STRING,
    "Gift Level", STRING,
    "Gifts Needed", INTEGER,
    "Prospects Needed", INTEGER,
    "Dollars Needed", CURRENCY,
    "Cumulative Total", CURRENCY,
    {
        { "Biggest", "#####", #####, #####, #####, #####},
        { "Bigger", "#####", #####, #####, #####, ##### },
        { "Big", "#####", #####, #####, #####, #####}
    }
)&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 14:09:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798192#M4741</guid>
      <dc:creator>MarkPalmberg</dc:creator>
      <dc:date>2019-09-20T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798718#M4768</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="61102" data-lia-user-login="MarkPalmberg" class="lia-mention lia-mention-user"&gt;MarkPalmberg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Not sure I understand what you are asking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I get. Seems pretty cool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Term	Definition
ColumnName	Any DAX expression that returns a table.
DataType	An enumeration that includes: INTEGER, DOUBLE, STRING, BOOLEAN, CURRENCY, DATETIME
Value	A single argument using Excel syntax for a one dimensional array constant, nested to provide an array of arrays. This argument represents the set of data values that will be in the table

For example,
{ {values in row1}, {values in row2}, {values in row3}, etc. }
Where {values in row1} is a comma delimited set of constant expressions, namely a combination of constants, combined with a handful of basic functions including DATE, TIME, and BLANK, as well as a plus operator between DATE and TIME and a unary minus operator so that negative values can be expressed.

The following are all valid values: 3, -5, BLANK(), "2009-04-15 02:45:21". Values may not refer to anything outside the immediate expression, and cannot refer to columns, tables, relationships, or anything else.

A missing value will be treated identically to BLANK(). For example, the following are the same: {1,2,BLANK(),4} {1,2,,4}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 00:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798718#M4768</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-22T00:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798722#M4769</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Unlike DATATABLE,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/table-constructor" target="_blank" rel="noopener"&gt;Table Constructor&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;allows any scalar expressions as input values. Seems like you have to enumerate the type in DATATABLE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.&lt;BR /&gt;Nathaniel&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 00:28:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/798722#M4769</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-22T00:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/800973#M4843</link>
      <description>&lt;P&gt;Sorry I wasn't very clear,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159166" data-lia-user-login="Nathaniel_C" class="lia-mention lia-mention-user"&gt;Nathaniel_C&lt;/a&gt;&amp;nbsp;! I need a table with multiple "Gift Level" values for my "Bigger" value in the "Level Name" column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking a look at this; I appreciate your time.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:28:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/800973#M4843</guid>
      <dc:creator>MarkPalmberg</dc:creator>
      <dc:date>2019-09-24T16:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/800981#M4845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="61102" data-lia-user-login="MarkPalmberg" class="lia-mention lia-mention-user"&gt;MarkPalmberg&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I guess I still don't understand. Could you dummy up a picture of your expected outlook?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:32:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/800981#M4845</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-24T16:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801090#M4846</link>
      <description>&lt;P&gt;Reading your last reply turned on a lightbulb for me,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159166" data-lia-user-login="Nathaniel_C" class="lia-mention lia-mention-user"&gt;Nathaniel_C&lt;/a&gt;&amp;nbsp;. *My* issue was that I was trying to shoehorn an Excel format into a Power BI table; see below. The answer simply seems to be (duh) to create multiple instances of my Bigger row:&lt;/P&gt;&lt;PRE&gt;Gift Table = 
DATATABLE (
    "Gift Level Name", STRING,
    "Gift Level", STRING,
    "Gifts Needed", INTEGER,
    "Prospects Needed", INTEGER,
    "Dollars Needed", CURRENCY,
    "Cumulative Total", CURRENCY,
    {
        { "Biggest", "#####1", #####, #####, #####, #####},
        { "Bigger", "#####1", #####, #####, #####, ##### },
        { "Bigger", "#####2", #####, #####, #####, ##### },
        { "Bigger", "#####3", #####, #####, #####, ##### },
        { "Big", "#####1", #####, #####, #####, #####},
        { "Big", "#####2", #####, #####, #####, #####},
        { "Big", "#####3", #####, #####, #####, #####}

    }
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 20:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801090#M4846</guid>
      <dc:creator>MarkPalmberg</dc:creator>
      <dc:date>2019-09-24T20:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801111#M4848</link>
      <description>&lt;P&gt;Wow! Does it work? Usually I might just have the first column on multiple rows.&lt;/P&gt;&lt;P&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 21:01:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801111#M4848</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-24T21:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: DATATABLE code help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801126#M4849</link>
      <description>&lt;P&gt;Yes, "first column in multiple rows" is how it's going to have to work in Power BI, I think, Which is probably fine, maybe in a Matrix visualization? Now the trick will be if I can populate my numeric values with VARs when I create the table. I was thinking I read somewhere that I can. Like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Gift Table = 
VAR BIGGER1 =
CALCULATE(
    SUM(SOMECOLUMN),
    SOMEFILTER)
RETURN
DATATABLE (
    "Gift Level Name", STRING,
    "Gift Level", STRING,
    "Gifts Needed", INTEGER,
    "Prospects Needed", INTEGER,
    "Dollars Needed", CURRENCY,
    "Cumulative Total", CURRENCY,
    {
        { "Biggest", "#####1", #####, #####, #####, #####},
        { "Bigger", BIGGER1, #####, #####, #####, ##### },
        { "Bigger", "#####2", #####, #####, #####, ##### },
        { "Bigger", "#####3", #####, #####, #####, ##### },
        { "Big", "#####1", #####, #####, #####, #####},
        { "Big", "#####2", #####, #####, #####, #####},
        { "Big", "#####3", #####, #####, #####, #####}

    }
)&lt;/PRE&gt;&lt;P&gt;Thanks for your replies,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159166" data-lia-user-login="Nathaniel_C" class="lia-mention lia-mention-user"&gt;Nathaniel_C&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 21:34:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATATABLE-code-help/m-p/801126#M4849</guid>
      <dc:creator>MarkPalmberg</dc:creator>
      <dc:date>2019-09-24T21:34:26Z</dc:date>
    </item>
  </channel>
</rss>

