<?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: Dax expression for multiple tables columns passing as a filter in calculate measure. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2400694#M62803</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , if the table which has the base columns [SP] is joined with these tables/dimensions. And these dimensions are fitting that table (on the many side in on to many, and have bi-direction join in case of many to many). Then slicer should automatically filter the measure &lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2022 13:11:47 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-03-17T13:11:47Z</dc:date>
    <item>
      <title>Dax expression for multiple tables columns passing as a filter in calculate measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2400405#M62786</link>
      <description>&lt;P&gt;I have few tables - Date, Store, Item , product tables&lt;/P&gt;&lt;P&gt;From Date Table - Date(YEAR), Date(Month)&lt;BR /&gt;From Store Table - Store(RUName)&lt;/P&gt;&lt;P&gt;From Item Table - Item(itemName)&lt;BR /&gt;From Product Table - Product(ProductName)&lt;BR /&gt;And Now I have one Measure ie., [SP]&lt;BR /&gt;&lt;BR /&gt;I am trying to retrieve the [SP] data with all above filter values&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can I get some logic, how I can pass all those filters in DAX&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 10:49:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2400405#M62786</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-17T10:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dax expression for multiple tables columns passing as a filter in calculate measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2400694#M62803</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , if the table which has the base columns [SP] is joined with these tables/dimensions. And these dimensions are fitting that table (on the many side in on to many, and have bi-direction join in case of many to many). Then slicer should automatically filter the measure &lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 13:11:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2400694#M62803</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-17T13:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dax expression for multiple tables columns passing as a filter in calculate measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2406313#M63189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think there should be a data table with [Year], [Month] or [YearMonth]/[Date],[RUName],[ItemName],[ProductName] and [Value] columns in it. Measure [SP] is based on [Value] column in data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if you create relationships as&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/148838" target="_self" aria-label="View Profile of amitchandak"&gt;amitchandak&lt;/A&gt; mentioned, you can filter [SP] measure by slicer or filter by columns in these four tables.&lt;/P&gt;
&lt;P&gt;Relationship Sample should looks like as below. These four tables are Dim tables.&lt;/P&gt;
&lt;P&gt;Date[YearMonth]/[Date] - Data[YearMonth]/[Date]&lt;BR /&gt;Store[RUName] - Data[RUName]&lt;/P&gt;
&lt;P&gt;Item[itemName] - Data[itemName]&lt;BR /&gt;Product[ProductName] - Data[ProductName]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;Date table and Data table only has [Year] and [Month] instead of&amp;nbsp;[YearMonth] or [Date]. There could only be one active relationship. So you can try USERELATIONSHIO function in DAX.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SP =
CALCULATE (
    SUM ( 'Data'[Value] ),
    USERELATIONSHIP ( 'Date'[Month], 'Data'[Month] )
)&lt;/LI-CODE&gt;
&lt;P&gt;If there are no relationships between your Data table and these four Dimtables, you can try this code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SP =
VAR _SELECTYEAR =
    VALUES ( 'Date'[Year] )
VAR _SELECTMONTH =
    VALUES ( 'Date'[Month] )
VAR _SELECTRUName =
    VALUES ( 'Store'[RUName] )
VAR _SELECTItemName =
    VALUES ( 'Item'[itemName] )
VAR _SELECTProductName =
    VALUES ( 'Product'[ProductName] )
RETURN
    CALCULATE (
        SUM ( 'Data'[Value] ),
        FILTER (
            'Data',
            'Data'[Year]
                IN _SELECTYEAR
                &amp;amp;&amp;amp; 'Data'[Month]
                IN _SELECTMONTH
                &amp;amp;&amp;amp; 'Data'[RUName]
                IN _SELECTRUName
                &amp;amp;&amp;amp; 'Data'[itemName]
                IN _SELECTItemName
                &amp;amp;&amp;amp; 'Data'[ProductName] IN _SELECTProductName
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Then you can filter [SP] by slicers or filters from columns in these four dimtables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 09:43:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-expression-for-multiple-tables-columns-passing-as-a-filter/m-p/2406313#M63189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-21T09:43:09Z</dc:date>
    </item>
  </channel>
</rss>

