<?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: Newbie trying to combine data/metrics for text that is the same (like pivot table) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3995093#M155165</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp;, please allow me to provide addition:&lt;/P&gt;
&lt;P&gt;Based on your information, I create a table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a calculated column and try the following dax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Campaign City = 
SWITCH (
    TRUE (),
    CONTAINSSTRING ( [Campaign], "SLC" ), "Salt Lake City",
    CONTAINSSTRING ( [Campaign], "DEN" ), "Denver",
    CONTAINSSTRING ( [Campaign], "PDX" ), "Portland",
    CONTAINSSTRING ( [Campaign], "SEA" ), "Seattle",
    "Other"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my preview:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 02:01:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-17T02:01:00Z</dc:date>
    <item>
      <title>Newbie trying to combine data/metrics for text that is the same (like pivot table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3993919#M155038</link>
      <description>&lt;P&gt;I'm new to DAX and what I have is marketing campaign data with metric associated. For example, we have multiple campaigns with names that include "DEN" or "SEA" for Denver and Seattle. What I'd like to do is find all the campaign names that contain "DEN" and combine them into a new field that is just "Denver" and combines all the data for the campaigns that share DEN in the name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the screenshot you'll see there are multiple campaigns with DEN in the name and I've brought this into PowerBI and would like to consolidate all these into one line for all Denver campaigns. So it would combine cost, impressions, clicks etc. Is there a way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use Data Studio and this is how I'd do it there with regular expression:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;And then when I use that field it would have the values as denver, portland.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 20:24:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3993919#M155038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-14T20:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie trying to combine data/metrics for text that is the same (like pivot table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3994235#M155082</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can create a new column and use the SEARCH function to accomplish your goal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calculated Column =
SWITCH (
    TRUE (),
    SEARCH ( "SLC", 'Table'[Campaign], 1, 0 ), "Salt Lake City",
    SEARCH ( "DEN", 'Table'[Campaign], 1, 0 ), "Denver",
    SEARCH ( "PDX", 'Table'[Campaign], 1, 0 ), "Portland",
    SEARCH ( "SEA", 'Table'[Campaign], 1, 0 ), "Seattle",
    "Other"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 09:39:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3994235#M155082</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-06-15T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie trying to combine data/metrics for text that is the same (like pivot table)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3995093#M155165</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp;, please allow me to provide addition:&lt;/P&gt;
&lt;P&gt;Based on your information, I create a table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a calculated column and try the following dax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Campaign City = 
SWITCH (
    TRUE (),
    CONTAINSSTRING ( [Campaign], "SLC" ), "Salt Lake City",
    CONTAINSSTRING ( [Campaign], "DEN" ), "Denver",
    CONTAINSSTRING ( [Campaign], "PDX" ), "Portland",
    CONTAINSSTRING ( [Campaign], "SEA" ), "Seattle",
    "Other"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my preview:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 02:01:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Newbie-trying-to-combine-data-metrics-for-text-that-is-the-same/m-p/3995093#M155165</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-17T02:01:00Z</dc:date>
    </item>
  </channel>
</rss>

