<?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: create list of dates with same values on dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-list-of-dates-with-same-values-on-dax/m-p/2766484#M85934</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your M code, I think first part for&amp;nbsp;&lt;SPAN&gt;investor A will return 8 values, however there are only four keys in your table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; {{
List.Dates( #date(2022,8, 1),  Number.From(DateTime.Date(DateTime.LocalNow())- #date(2022, 7, 31)) , #duration(1, 0, 0, 0)), 
Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error,"Investor A",-10000,0.10}}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here I suggest you to try this M code to achieve your goal.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.Combine({
    Table.FromRows(
        {{
List.Dates( #date(2022,8, 1),  Number.From(DateTime.Date(DateTime.LocalNow())- #date(2022, 7, 31)) , #duration(1, 0, 0, 0)), 
"Investor A",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    )
}),
    #"Expanded Date" = Table.ExpandListColumn(Source, "Date"),
    #"Combine" =
    Table.Combine({
#"Expanded Date",
        Table.FromRows(
        {{"8/1/2022","Investor B",-5000,0.05}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"8/1/2022","Investor C",-15000,0.15}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
 Table.FromRows(
        {{"8/1/2022","Investor D",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"9/1/2022","Investor E",-20000,0.2}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    )
}),
    #"Changed Type" = Table.TransformColumnTypes(Combine,{{"Date", type date}, {"Investment Company", type text}, {"Initial Value", Int64.Type}, {"Percentage", Percentage.Type}})
in
    #"Changed Type"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Result is as below.&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;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 08:06:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-14T08:06:04Z</dc:date>
    <item>
      <title>create list of dates with same values on dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-list-of-dates-with-same-values-on-dax/m-p/2764745#M85843</link>
      <description>&lt;LI-CODE lang="markup"&gt;let
    Source = Table.Combine({
    Table.FromRows(
        {{
List.Dates( #date(2022,8, 1),  Number.From(DateTime.Date(DateTime.LocalNow())- #date(2022, 7, 31)) , #duration(1, 0, 0, 0)), 
Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error,"Investor A",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
 Table.FromRows(
        {{"8/1/2022","Investor B",-5000,0.05}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"8/1/2022","Investor C",-15000,0.15}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
 Table.FromRows(
        {{"8/1/2022","Investor D",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"9/1/2022","Investor E",-20000,0.2}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    )
}),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Investment Company", type text}, {"Initial Value", Currency.Type}, {"Percentage", Percentage.Type}})
in
    #"Changed Type"&lt;/LI-CODE&gt;&lt;P&gt;i tried to make a code that lists date and i want the same value so for example i nvestor A to always have 10,000 on initial value, 0.1 on percentage&lt;BR /&gt;&lt;BR /&gt;because i want to createa&amp;nbsp; relationship between table and date table&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 14:49:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-list-of-dates-with-same-values-on-dax/m-p/2764745#M85843</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T14:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: create list of dates with same values on dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-list-of-dates-with-same-values-on-dax/m-p/2766484#M85934</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your M code, I think first part for&amp;nbsp;&lt;SPAN&gt;investor A will return 8 values, however there are only four keys in your table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; {{
List.Dates( #date(2022,8, 1),  Number.From(DateTime.Date(DateTime.LocalNow())- #date(2022, 7, 31)) , #duration(1, 0, 0, 0)), 
Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error,"Investor A",-10000,0.10}}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here I suggest you to try this M code to achieve your goal.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.Combine({
    Table.FromRows(
        {{
List.Dates( #date(2022,8, 1),  Number.From(DateTime.Date(DateTime.LocalNow())- #date(2022, 7, 31)) , #duration(1, 0, 0, 0)), 
"Investor A",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    )
}),
    #"Expanded Date" = Table.ExpandListColumn(Source, "Date"),
    #"Combine" =
    Table.Combine({
#"Expanded Date",
        Table.FromRows(
        {{"8/1/2022","Investor B",-5000,0.05}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"8/1/2022","Investor C",-15000,0.15}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
 Table.FromRows(
        {{"8/1/2022","Investor D",-10000,0.10}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    ),
     Table.FromRows(
        {{"9/1/2022","Investor E",-20000,0.2}},
        {"Date", "Investment Company","Initial Value","Percentage"}
    )
}),
    #"Changed Type" = Table.TransformColumnTypes(Combine,{{"Date", type date}, {"Investment Company", type text}, {"Initial Value", Int64.Type}, {"Percentage", Percentage.Type}})
in
    #"Changed Type"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Result is as below.&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;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 08:06:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/create-list-of-dates-with-same-values-on-dax/m-p/2766484#M85934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T08:06:04Z</dc:date>
    </item>
  </channel>
</rss>

