<?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: Lookup multiple conditions in ReportTable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-multiple-conditions-in-ReportTable/m-p/3061366#M105797</link>
    <description>&lt;P&gt;Here's an example of a measure that would find the ProductPrice from the List account row with the same Product ID and Currency&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List Price (SUMX) = 

VAR _listPrice = 
    SUMX(
        FactTable
        , IF(
            FactTable[Account] &amp;lt;&amp;gt; "List"
            , CALCULATE(
                SELECTEDVALUE(FactTable[ProductPrice])
                , FactTable[Account] = "List"
                , ALLEXCEPT(
                    FactTable
                    , FactTable[Currency]
                    , FactTable[Product ID]
                )
            )
        )
    
)

RETURN _listPrice&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of a calculated column that would show the list price for the current row. For the "List" rows this would be blank.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List Price (Col) = 

VAR _listPrice = IF(
    FactTable[Account] &amp;lt;&amp;gt; "List"
    , CALCULATE(
        MIN(FactTable[ProductPrice])
        , FactTable[Account] = "List"
        , REMOVEFILTERS(
            FactTable[Account]
            , FactTable[ProductPrice]
        )
    )
    
)

RETURN _listPrice&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's your sample dataset:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having the list prices in the same table as real sale prices seems like it could be an issue if the future if the types of information you need to record for accounts vs list prices changes in future, or if you need to record changes in list prices and&amp;nbsp;identify the list price as it was at the time of the the sale. The concept of a Type 2 Slowly Changing Dimension could help if that is a concern.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Feb 2023 04:47:12 GMT</pubDate>
    <dc:creator>andrewpirie</dc:creator>
    <dc:date>2023-02-04T04:47:12Z</dc:date>
    <item>
      <title>Lookup multiple conditions in ReportTable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-multiple-conditions-in-ReportTable/m-p/3060522#M105731</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New to DAX and struggling to find a measure for this:&lt;/P&gt;&lt;P&gt;I want to add a column to my &lt;STRONG&gt;ReportTable&lt;/STRONG&gt; which displays the Listprice for a certain Product. I have to check the rows &lt;STRONG&gt;Product&lt;/STRONG&gt; and &lt;STRONG&gt;Currency&lt;/STRONG&gt;&amp;nbsp;of the &lt;STRONG&gt;ReportTable&lt;/STRONG&gt; and look them up for &lt;STRONG&gt;Account&lt;/STRONG&gt;=&lt;STRONG&gt;List&lt;/STRONG&gt; in the &lt;STRONG&gt;FactTable&lt;/STRONG&gt;, then return &lt;STRONG&gt;Price.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tried LOOKUPVALUE(), but it does not seem to work here as i am looking up multiple values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of creating a measure, adding a custom column &lt;STRONG&gt;ListPrice&lt;/STRONG&gt; to the FactTable would also work for me, but again struggling to find a solution here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ReportTable&lt;/STRONG&gt; (with filter &lt;STRONG&gt;Account&lt;/STRONG&gt;=&lt;STRONG&gt;Customer1&lt;/STRONG&gt; and &lt;STRONG&gt;Product&lt;/STRONG&gt;=&lt;STRONG&gt;111&lt;/STRONG&gt;)&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Price&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;ListPrice&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer1&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FactTable&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Price&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Currency&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer1&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;EUR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer2&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;TD&gt;EUR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer3&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;TD&gt;USD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;List&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;EUR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;List&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;TD&gt;USD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Customer1&lt;/TD&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;190&lt;/TD&gt;&lt;TD&gt;EUR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;List&lt;/TD&gt;&lt;TD&gt;112&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;EUR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for any input here!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 14:59:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-multiple-conditions-in-ReportTable/m-p/3060522#M105731</guid>
      <dc:creator>JakobH</dc:creator>
      <dc:date>2023-02-03T14:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup multiple conditions in ReportTable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-multiple-conditions-in-ReportTable/m-p/3061366#M105797</link>
      <description>&lt;P&gt;Here's an example of a measure that would find the ProductPrice from the List account row with the same Product ID and Currency&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List Price (SUMX) = 

VAR _listPrice = 
    SUMX(
        FactTable
        , IF(
            FactTable[Account] &amp;lt;&amp;gt; "List"
            , CALCULATE(
                SELECTEDVALUE(FactTable[ProductPrice])
                , FactTable[Account] = "List"
                , ALLEXCEPT(
                    FactTable
                    , FactTable[Currency]
                    , FactTable[Product ID]
                )
            )
        )
    
)

RETURN _listPrice&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of a calculated column that would show the list price for the current row. For the "List" rows this would be blank.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;List Price (Col) = 

VAR _listPrice = IF(
    FactTable[Account] &amp;lt;&amp;gt; "List"
    , CALCULATE(
        MIN(FactTable[ProductPrice])
        , FactTable[Account] = "List"
        , REMOVEFILTERS(
            FactTable[Account]
            , FactTable[ProductPrice]
        )
    )
    
)

RETURN _listPrice&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's your sample dataset:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having the list prices in the same table as real sale prices seems like it could be an issue if the future if the types of information you need to record for accounts vs list prices changes in future, or if you need to record changes in list prices and&amp;nbsp;identify the list price as it was at the time of the the sale. The concept of a Type 2 Slowly Changing Dimension could help if that is a concern.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 04:47:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-multiple-conditions-in-ReportTable/m-p/3061366#M105797</guid>
      <dc:creator>andrewpirie</dc:creator>
      <dc:date>2023-02-04T04:47:12Z</dc:date>
    </item>
  </channel>
</rss>

