<?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: Lookupvalue DAX with a table multiples values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673201#M79783</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The LOOKUPVALUE does not take the date into account, so there are multiple results (3 in total, 1 for each date). This is not allowed. A measure can only return 1 value. You need to add a filter context for the correct date. This is best done with a CALCULATE function.&amp;nbsp;Always try to work with CALCUATE as much as possible and avoid LOOKUPVALUE, this is best practice.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FD =
VAR fecha_curva =
    DATE ( 2021, 12, 30 )
VAR x1 = 1
VAR x2 = 15
VAR y1 =
    CALCULATE (
        SELECTEDVALUE ( uf_prosp[_tasas] ),
        KEEPFILTERS ( uf_prosp[_plazo] = x1 ),
        KEEPFILTERS ( uf_prosp[fecha_curva] = fecha_curva )
    )
VAR y2 =
    CALCULATE (
        SELECTEDVALUE ( uf_prosp[_tasas] ),
        KEEPFILTERS ( uf_prosp[_plazo] = x2 ),
        KEEPFILTERS ( uf_prosp[fecha_curva] = fecha_curva )
    )
RETURN
    y1 * y2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 14:10:45 GMT</pubDate>
    <dc:creator>Barthel</dc:creator>
    <dc:date>2022-08-01T14:10:45Z</dc:date>
    <item>
      <title>Lookupvalue DAX with a table multiples values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673035#M79777</link>
      <description>&lt;P&gt;Hello everyone. I'll really appreacite your help.&lt;/P&gt;&lt;P&gt;I have a table named &lt;FONT color="#0000FF"&gt;uf_prosp&lt;/FONT&gt; with data for bussiness day (&lt;FONT color="#FF0000"&gt;_plazo&lt;/FONT&gt;) and interest rates (&lt;FONT color="#FF0000"&gt;_tasas&lt;/FONT&gt;) for every end of month (&lt;FONT color="#FF0000"&gt;_fecha_curva&lt;/FONT&gt;).&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column &lt;FONT color="#FF0000"&gt;_fecha_curva&lt;/FONT&gt; has data for 12/30/2021, 01/31/2022 and 02/28/2022.&lt;/P&gt;&lt;P&gt;How can i say to this measure to look for to VAR y1 and VAR y2 accordind to&amp;nbsp;date(2021,12,30)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FD =&lt;BR /&gt;VAR fecha_curva = date(2021,12,30)&lt;/P&gt;&lt;P&gt;VAR x1 = 1&lt;/P&gt;&lt;P&gt;VAR x2 = 15&lt;BR /&gt;VAR y1 = LOOKUPVALUE(uf_prosp[&lt;FONT color="#FF0000"&gt;_tasas&lt;/FONT&gt;],uf_prosp[&lt;FONT color="#FF0000"&gt;_plazo&lt;/FONT&gt;],x1)&lt;BR /&gt;VAR y2 = LOOKUPVALUE(uf_prosp[&lt;FONT color="#FF0000"&gt;_tasas&lt;/FONT&gt;],uf_prosp[&lt;FONT color="#FF0000"&gt;_plazo&lt;/FONT&gt;],x2)&lt;/P&gt;&lt;P&gt;RETURN y1 * y2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error message&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 13:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673035#M79777</guid>
      <dc:creator>jgorigo</dc:creator>
      <dc:date>2022-08-01T13:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lookupvalue DAX with a table multiples values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673201#M79783</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The LOOKUPVALUE does not take the date into account, so there are multiple results (3 in total, 1 for each date). This is not allowed. A measure can only return 1 value. You need to add a filter context for the correct date. This is best done with a CALCULATE function.&amp;nbsp;Always try to work with CALCUATE as much as possible and avoid LOOKUPVALUE, this is best practice.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FD =
VAR fecha_curva =
    DATE ( 2021, 12, 30 )
VAR x1 = 1
VAR x2 = 15
VAR y1 =
    CALCULATE (
        SELECTEDVALUE ( uf_prosp[_tasas] ),
        KEEPFILTERS ( uf_prosp[_plazo] = x1 ),
        KEEPFILTERS ( uf_prosp[fecha_curva] = fecha_curva )
    )
VAR y2 =
    CALCULATE (
        SELECTEDVALUE ( uf_prosp[_tasas] ),
        KEEPFILTERS ( uf_prosp[_plazo] = x2 ),
        KEEPFILTERS ( uf_prosp[fecha_curva] = fecha_curva )
    )
RETURN
    y1 * y2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673201#M79783</guid>
      <dc:creator>Barthel</dc:creator>
      <dc:date>2022-08-01T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lookupvalue DAX with a table multiples values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673271#M79789</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Now it works perfec. Thank so much!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:34:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookupvalue-DAX-with-a-table-multiples-values/m-p/2673271#M79789</guid>
      <dc:creator>jgorigo</dc:creator>
      <dc:date>2022-08-01T14:34:37Z</dc:date>
    </item>
  </channel>
</rss>

