<?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 Populating a new column from a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4303722#M170884</link>
    <description>&lt;P&gt;I have a measure which counts the number of stores opening on certain months and i was wanting to create a new column with these values if it is possible ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Nov 2024 08:26:10 GMT</pubDate>
    <dc:creator>Jay2022</dc:creator>
    <dc:date>2024-11-27T08:26:10Z</dc:date>
    <item>
      <title>Populating a new column from a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4303722#M170884</link>
      <description>&lt;P&gt;I have a measure which counts the number of stores opening on certain months and i was wanting to create a new column with these values if it is possible ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 08:26:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4303722#M170884</guid>
      <dc:creator>Jay2022</dc:creator>
      <dc:date>2024-11-27T08:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a new column from a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4303758#M170886</link>
      <description>&lt;P&gt;Yes, you can create a new column in Power BI using the values from a measure, but it requires a bit of a workaround since measures and columns behave differently. Here’s a step-by-step guide to help you achieve this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Calculated Column&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go to the “Modeling” tab in Power BI Desktop.&lt;/LI&gt;&lt;LI&gt;Select “New Column”.&lt;/LI&gt;&lt;LI&gt;Use a DAX formula to create the column. For example, if your measure is called&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;StoreOpenings, you can use a formula like:&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpeningsColumn = [StoreOpenings]&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;This will create a new column with the values from your measure.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Using a Calculated Table&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sometimes, creating a calculated table might be more appropriate, especially if you need to aggregate data differently.&lt;/LI&gt;&lt;LI&gt;You can create a calculated table using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function to group your data by month and then add the measure values.&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpeningsTable = 
SUMMARIZE(
    'YourTable',
    'YourTable'[Month],
    "StoreOpenings", [StoreOpenings]
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Using Variables in Measures&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If you need to use the measure in a more complex calculation, you can define variables within your measure to store intermediate results.&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpeningsWithVariable = 
VAR Openings = [StoreOpenings]
RETURN
Openings&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;These methods should help you incorporate the measure values into a new column or table.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Turning-a-measure-into-a-column/m-p/331989" target="_blank" rel="noopener"&gt;If you need more detailed guidance, there are many tutorials and community forums that can provide additional examples and support.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also Follow given below link, i hope this will help you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Turning-a-measure-into-a-column/m-p/331989" target="_blank" rel="noopener"&gt;Solved: Turning a measure into a column - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Column-Based-on-Values-From-a-Measure/m-p/640771" target="_blank" rel="noopener"&gt;Solved: Column Based on Values From a Measure - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=ns4VbpRKAFs" target="_blank" rel="noopener"&gt;Blessed Friday Sale | Web Hosting | Hostinger.pk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=90X5_tISxIY" target="_blank" rel="noopener"&gt;Use Measures as Columns Using Calculation Group in Power BI&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 08:38:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4303758#M170886</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-11-27T08:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a new column from a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4305885#M170975</link>
      <description>&lt;P&gt;Thanks in your 2nd example what does the "storeopenings" in brackets refer to please ? STruggling to get P Bi to accept my code when i try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;StoreOpeningsTable = 
SUMMARIZE(
    'YourTable',
    'YourTable'[Month],
    "StoreOpenings", [StoreOpenings]
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Nov 2024 09:18:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4305885#M170975</guid>
      <dc:creator>Jay2022</dc:creator>
      <dc:date>2024-11-28T09:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a new column from a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4305940#M170982</link>
      <description>&lt;P&gt;In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"StoreOpenings"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in brackets refers to the name of the new column that will be created in the summarized table. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[StoreOpenings]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;part is supposed to be the measure or column that you want to summarize.&lt;/P&gt;&lt;P&gt;Here’s a breakdown of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;'YourTable': The table you are summarizing.&lt;/LI&gt;&lt;LI&gt;'YourTable'[Month]: The column by which you want to group the data.&lt;/LI&gt;&lt;LI&gt;"StoreOpenings": The name of the new column in the summarized table.&lt;/LI&gt;&lt;LI&gt;[StoreOpenings]: The measure or column that contains the values you want to summarize.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If Power BI is not accepting your code, it might be due to the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[StoreOpenings]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;measure not being defined correctly. Ensure that you have a measure named&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[StoreOpenings]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in your model. For example:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Define the Measure&lt;/STRONG&gt;:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpenings = COUNTROWS(FILTER('YourTable', 'YourTable'[OpeningDate] = [SelectedMonth]))&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Use the Measure in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;/STRONG&gt;:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpeningsTable = 
SUMMARIZE(
    'YourTable',
    'YourTable'[Month],
    "StoreOpenings", [StoreOpenings]
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you don’t have a measure named&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[StoreOpenings], you need to create it first. Here’s a complete example:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create the Measure&lt;/STRONG&gt;:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpenings = 
CALCULATE(
    COUNTROWS('YourTable'),
    FILTER('YourTable', MONTH('YourTable'[OpeningDate]) = MONTH(TODAY()))
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create the Summarized Table&lt;/STRONG&gt;:&lt;/P&gt;&lt;DIV class=""&gt;&lt;PRE&gt;StoreOpeningsTable = 
SUMMARIZE(
    'YourTable',
    'YourTable'[Month],
    "StoreOpenings", [StoreOpenings]
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Make sure that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[StoreOpenings]&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is correctly defined and available in your model before using it in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SUMMARIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function. If you still encounter issues, please share the specific error message you’re getting, and I’ll be happy to help further!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 09:44:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Populating-a-new-column-from-a-measure/m-p/4305940#M170982</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-11-28T09:44:16Z</dc:date>
    </item>
  </channel>
</rss>

