<?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: Need Help in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905738#M186507</link>
    <description>&lt;P&gt;Please check the formula below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Campaign Sales =
VAR SelectedCustomers =
    VALUES ( CampaignMapping[CustomerID] )

VAR SelectedCategories =
    VALUES ( CampaignMapping[ProductCategory] )

RETURN
CALCULATE (
    [Total Sales],
    TREATAS ( SelectedCustomers, Customers[CustomerID] ),
    TREATAS ( SelectedCategories, Products[ProductCategory] )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 19 Dec 2025 11:23:22 GMT</pubDate>
    <dc:creator>cengizhanarslan</dc:creator>
    <dc:date>2025-12-19T11:23:22Z</dc:date>
    <item>
      <title>Need Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905689#M186499</link>
      <description>&lt;P&gt;I have a disconnected&amp;nbsp;CampaignMapping&amp;nbsp;table with columns (CampaignName, CustomerID, ProductCategory) where the granularity is a many-to-many combination, while&amp;nbsp;Sales&amp;nbsp;is at the Order/Product level related only to standard dimensions (Customers, Products, Date).&lt;/P&gt;&lt;P&gt;This granularity mismatch makes physical relationships impossible. How can I write a&amp;nbsp;Campaign Sales&amp;nbsp;measure in DAX so that selecting CampaignName on a slicer virtually filters Sales by both CustomerID and ProductCategory matches?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 10:56:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905689#M186499</guid>
      <dc:creator>Ar_Sh</dc:creator>
      <dc:date>2025-12-19T10:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905696#M186500</link>
      <description>&lt;P class=""&gt;You can create a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Campaign Sales&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;measure by building a virtual relationship from the disconnected CampaignMapping table to Sales using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;TREATAS&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on both CustomerID and ProductCategory.&lt;SPAN&gt;​&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;1. Base measure&lt;/H2&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN&gt;Sales Amount := SUM ( Sales[Amount] ) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H2&gt;2. Campaign Sales measure using TREATAS&lt;/H2&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN&gt;Campaign Sales := CALCULATE ( [Sales Amount], TREATAS ( VALUES ( CampaignMapping[CustomerID] ), Customers[CustomerID] ), TREATAS ( VALUES ( CampaignMapping[ProductCategory] ), Products[Category] ) ) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H2&gt;3. Explanation&amp;nbsp;&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class=""&gt;&lt;STRONG&gt;VALUES(CampaignMapping[CustomerID])&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns the distinct customers for the currently selected campaign(s).&lt;SPAN&gt;​&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;The first&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;TREATAS&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tells the engine to treat those values as if they came from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Customers[CustomerID]&lt;/STRONG&gt;, so the row context on Sales is filtered by matching customers.&lt;SPAN&gt;​&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;The second&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;TREATAS&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;does the same for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;ProductCategory → Products[Category]&lt;/STRONG&gt;, so only Sales rows where both customer and category match the campaign remain.&lt;SPAN&gt;​&lt;/SPAN&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class=""&gt;Because TREATAS creates a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;virtual relationship&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;instead of a physical one, it works even though the CampaignMapping granularity (Campaign–Customer–Category) does not match the Sales fact granularity.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 19 Dec 2025 10:58:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905696#M186500</guid>
      <dc:creator>Shubham_rai955</dc:creator>
      <dc:date>2025-12-19T10:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905734#M186506</link>
      <description>&lt;P&gt;My advice is creating a CampaignBridge table at the same grain as Sales.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 11:21:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905734#M186506</guid>
      <dc:creator>anilelmastasi</dc:creator>
      <dc:date>2025-12-19T11:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905738#M186507</link>
      <description>&lt;P&gt;Please check the formula below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Campaign Sales =
VAR SelectedCustomers =
    VALUES ( CampaignMapping[CustomerID] )

VAR SelectedCategories =
    VALUES ( CampaignMapping[ProductCategory] )

RETURN
CALCULATE (
    [Total Sales],
    TREATAS ( SelectedCustomers, Customers[CustomerID] ),
    TREATAS ( SelectedCategories, Products[ProductCategory] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Dec 2025 11:23:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help/m-p/4905738#M186507</guid>
      <dc:creator>cengizhanarslan</dc:creator>
      <dc:date>2025-12-19T11:23:22Z</dc:date>
    </item>
  </channel>
</rss>

