<?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: Creating new table with distinct rows from single column with multiple value types in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344685#M172525</link>
    <description>&lt;P&gt;Thank you for the awesome guidance!! I will give this a try and see how I end up.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*Edit* Unfortunately I couldn't get this to work with my data and kept receiving token syntax errors. Likely due to my limited understanding off the transformation steps converting it.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2024 21:32:47 GMT</pubDate>
    <dc:creator>TypingQuery</dc:creator>
    <dc:date>2024-12-27T21:32:47Z</dc:date>
    <item>
      <title>Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4343896#M172487</link>
      <description>&lt;P class="lia-align-left"&gt;Good day!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to do a few things with a table in order to filter by values in a single column, and also to calculate scores for the whole.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a table from a form with a unique Account ID, which has rows for each question:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account ID&lt;/TD&gt;&lt;TD&gt;Question ID&lt;/TD&gt;&lt;TD&gt;Response&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21234&lt;/TD&gt;&lt;TD&gt;22159&lt;/TD&gt;&lt;TD&gt;(A Name)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;21234&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;22160&lt;/TD&gt;&lt;TD&gt;(A Date)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21234&lt;/TD&gt;&lt;TD&gt;22161&lt;/TD&gt;&lt;TD&gt;"String"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21234&lt;/TD&gt;&lt;TD&gt;22162&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;yes/no/blank&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21234&lt;/TD&gt;&lt;TD&gt;22163&lt;/TD&gt;&lt;TD&gt;yes/no/blank&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;22159&lt;/TD&gt;&lt;TD&gt;(A Name)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;22160&lt;/TD&gt;&lt;TD&gt;(A Date)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;22161&lt;/TD&gt;&lt;TD&gt;"String"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;22162&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;yes/no/blank&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;22163&lt;/TD&gt;&lt;TD&gt;yes/no/blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each Yes/no/blank question, I have a score table that has a unique score for each question ID marked "Yes":&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Question ID&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22161&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22162&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22163&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using related to find the score for each account ID, which works somewhat, however I am unable to use filters based on the other responses, such as question ID 22159 to find the name. When filtered by those variables, the scores show as 0 and the items disappear.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Score =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Related&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Points Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Point Value]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;True "String" =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Data'&lt;/SPAN&gt;&lt;SPAN&gt;[Question ID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;26217&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Question Response]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Blank&lt;/SPAN&gt;&lt;SPAN&gt;()) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Since I have had no luck using measures or calculated columns effectively, I thought creating a transformed table might be easier.&lt;BR /&gt;&lt;BR /&gt;What I would like to do is create a table where the unique answers are placed into distinct columns, one of which is the calculated score total for each ID,&amp;nbsp; so I can use filters to transform that data. Something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Account ID&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;"String"&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21234&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;String&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21235&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;String&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Any and all assistance would be greatly appreciated. Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 19:36:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4343896#M172487</guid>
      <dc:creator>TypingQuery</dc:creator>
      <dc:date>2024-12-26T19:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344042#M172501</link>
      <description>&lt;LI-CODE lang="markup"&gt;What I would like to do is create a table where the unique answers are placed into distinct columns&lt;/LI-CODE&gt;
&lt;P&gt;Don't do that. Power BI is not Excel.&amp;nbsp; Your data is already in a good format.&amp;nbsp; Leave the pivoting work to the matrix visual.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 02:21:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344042#M172501</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-27T02:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344252#M172506</link>
      <description>&lt;P&gt;HIi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905826" data-lia-user-login="TypingQuery" class="lia-mention lia-mention-user"&gt;TypingQuery&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(see &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if that is what you want.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjI0MjZR0lEyMjI0tQTSGo4Kfom5qZpKsTookmYGEEmXxBIskoZAOrikKDMvHUPKCEhXphbr5+XrJ+Uk5mVjKDDGpcAUn7NM8TnLFLezTAk5yxSns2IB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account ID" = _t, #"Question ID" = _t, Response = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Account ID", Int64.Type}, {"Question ID", Int64.Type}, {"Response", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Account ID"},  {{"Index", each Table.AddIndexColumn(_, "Index",1,1), type table}}),
    #"Expanded Index" = Table.ExpandTableColumn(#"Grouped Rows", "Index", {"Question ID", "Response", "Index"}, {"Question ID", "Response", "Index"}),
    #"Added Custom" = Table.AddColumn(#"Expanded Index", "Score", each try #"Points Table"[Score]{List.PositionOf(#"Points Table"[Question ID],[Question ID])} otherwise null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom", each if [Index]&amp;gt;2 then [Score] else [Response]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Type", each if [Index]=1 then "Name" else if [Index]=2 then "Date" else "Score"),
    #"Removed Columns1" = Table.RemoveColumns(#"Added Custom2",{"Question ID", "Response", "Index", "Score"}),
    #"Grouped Rows1" = Table.Group(#"Removed Columns1", {"Account ID", "Type"}, {{"Data", each try List.Sum([Custom]) otherwise [Custom]{0} }}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows1", List.Distinct(#"Grouped Rows1"[Type]), "Type", "Data")
in
    #"Pivoted Column"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 06:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344252#M172506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-27T06:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344684#M172524</link>
      <description>&lt;P&gt;Thank you for the tip! I have no experience with that particular visual so I will explore it and see if I can get it to do what I need.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*Edit* Unfortunately I am in the same boat as before, and likely need a new measure or something to calculate score in order to use the matrix effectively as it does the same thing when I filter the page, clicking on an item to drill in and then the scores disappear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 15:11:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344684#M172524</guid>
      <dc:creator>TypingQuery</dc:creator>
      <dc:date>2024-12-27T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344685#M172525</link>
      <description>&lt;P&gt;Thank you for the awesome guidance!! I will give this a try and see how I end up.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*Edit* Unfortunately I couldn't get this to work with my data and kept receiving token syntax errors. Likely due to my limited understanding off the transformation steps converting it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 21:32:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4344685#M172525</guid>
      <dc:creator>TypingQuery</dc:creator>
      <dc:date>2024-12-27T21:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new table with distinct rows from single column with multiple value types</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4345753#M172581</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905826" data-lia-user-login="TypingQuery" class="lia-mention lia-mention-user"&gt;TypingQuery&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please share the codes with the syntax&amp;nbsp;error in your Advanced Editor? Later we can review it and give you a suitable solution. Thank you.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 03:11:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-new-table-with-distinct-rows-from-single-column-with/m-p/4345753#M172581</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-30T03:11:28Z</dc:date>
    </item>
  </channel>
</rss>

