<?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 pull real value from a column containing an key value array in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4663157#M178569</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1263307" data-lia-user-login="Moore55" class="lia-mention lia-mention-user"&gt;Moore55&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to the Microsoft Community Forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this M code in the custom column formula:&lt;/P&gt;
&lt;P&gt;let&lt;BR /&gt;optionsText = Text.Middle([Options], 1, Text.Length([Options]) - 2), // remove outer braces&lt;BR /&gt;optionsList = Text.Split(optionsText, ", "),&lt;BR /&gt;optionsRecord = Record.FromList(&lt;BR /&gt;List.Transform(optionsList, each Text.Trim(Text.AfterDelimiter(_, ":"))),&lt;BR /&gt;List.Transform(optionsList, each Text.Trim(Text.BeforeDelimiter(_, ":")))&lt;BR /&gt;)&lt;BR /&gt;in&lt;BR /&gt;Record.FieldOrDefault(optionsRecord, [Answer], null)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Apr 2025 12:15:23 GMT</pubDate>
    <dc:creator>v-dineshya</dc:creator>
    <dc:date>2025-04-22T12:15:23Z</dc:date>
    <item>
      <title>How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4661787#M178520</link>
      <description>&lt;P&gt;I am working on a report using a database that effectively contains data from a bunch of questions and answers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem i am encountering is the value being saved into the answer column is the key not the value but there is a separate column in the same table that contains all&amp;nbsp;the possible options for that question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example would look like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the options column I would have the following text:&lt;/P&gt;&lt;P&gt;{Option1: yes, option2: no, option3: I don't know}&lt;/P&gt;&lt;P&gt;And in the answer column I would have:&lt;/P&gt;&lt;P&gt;Option1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a clever way for me to create a new calculated or custom column that will pull the real value out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 19:22:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4661787#M178520</guid>
      <dc:creator>Moore55</dc:creator>
      <dc:date>2025-04-21T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4662261#M178538</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1263307" data-lia-user-login="Moore55" class="lia-mention lia-mention-user"&gt;Moore55&lt;/a&gt;&amp;nbsp;Open Power Query Editor by clicking on "Transform Data" in Power BI.&lt;BR /&gt;Select the table that contains your data.&lt;BR /&gt;Add a new custom column by clicking on "Add Column" &amp;gt; "Custom Column".&lt;BR /&gt;Use the following M code to extract the real value:&lt;/P&gt;
&lt;P&gt;let&lt;BR /&gt;Options = Text.Middle([options], 1, Text.Length([options]) - 2), // Remove the curly braces&lt;BR /&gt;OptionsList = Text.Split(Options, ", "), // Split the options into a list&lt;BR /&gt;KeyValuePairs = List.Transform(OptionsList, each Text.Split(_, ": ")), // Split each option into key-value pairs&lt;BR /&gt;AnswerKey = [answer], // Get the answer key&lt;BR /&gt;RealValue = List.First(List.Select(KeyValuePairs, each _ = AnswerKey)) // Find the value corresponding to the answer key&lt;BR /&gt;in&lt;BR /&gt;RealValue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Click "OK" to create the custom column.&lt;BR /&gt;Close and apply the changes to load the data back into Power BI.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 06:15:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4662261#M178538</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-04-22T06:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4663157#M178569</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1263307" data-lia-user-login="Moore55" class="lia-mention lia-mention-user"&gt;Moore55&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to the Microsoft Community Forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this M code in the custom column formula:&lt;/P&gt;
&lt;P&gt;let&lt;BR /&gt;optionsText = Text.Middle([Options], 1, Text.Length([Options]) - 2), // remove outer braces&lt;BR /&gt;optionsList = Text.Split(optionsText, ", "),&lt;BR /&gt;optionsRecord = Record.FromList(&lt;BR /&gt;List.Transform(optionsList, each Text.Trim(Text.AfterDelimiter(_, ":"))),&lt;BR /&gt;List.Transform(optionsList, each Text.Trim(Text.BeforeDelimiter(_, ":")))&lt;BR /&gt;)&lt;BR /&gt;in&lt;BR /&gt;Record.FieldOrDefault(optionsRecord, [Answer], null)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Apr 2025 12:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4663157#M178569</guid>
      <dc:creator>v-dineshya</dc:creator>
      <dc:date>2025-04-22T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4670547#M178895</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1263307" data-lia-user-login="Moore55" class="lia-mention lia-mention-user"&gt;Moore55&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 10:13:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4670547#M178895</guid>
      <dc:creator>v-dineshya</dc:creator>
      <dc:date>2025-04-28T10:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4670604#M178899</link>
      <description>&lt;P&gt;Thank you so mach this was a huge help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 10:30:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4670604#M178899</guid>
      <dc:creator>Moore55</dc:creator>
      <dc:date>2025-04-28T10:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4672676#M178954</link>
      <description>&lt;P&gt;Hey I have just discovered that the value column contains multiple choice answers as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in my value column I will have the text option1,option3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which causes an error with the code you suggested above as it can't match it to the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any way to nest a loop in m code? So can I create a list of my values and for every value loop through the other list for a match and output the real value to a concatenated string Column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the output would be a new column with test real value 1, test real value 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 10:01:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4672676#M178954</guid>
      <dc:creator>Moore55</dc:creator>
      <dc:date>2025-04-29T10:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull real value from a column containing an key value array</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4672711#M178957</link>
      <description>&lt;P&gt;Hey I discovered that the value column can be a multiple choice as well so in some cases the value will be stored like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;option1,option3,option9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to convert theay value column to a list and then loop through the code you provided based off the number of values in a new list and have it output the real value to a concatenated column? So I would want the column to look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Real value 1, real value 3, real value 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that makes sense and any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 10:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-pull-real-value-from-a-column-containing-an-key-value/m-p/4672711#M178957</guid>
      <dc:creator>Moore55</dc:creator>
      <dc:date>2025-04-29T10:20:15Z</dc:date>
    </item>
  </channel>
</rss>

