<?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 Getting a single column value based on another (unique) column value - Optimize in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1970672#M43278</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get a single column value from a table based on another (unique) column value. I've managed to get the value, but I have the feeling it's too clunky and could be made way simpler. Since my objective is not just to get something to work, but also to learn as much about DAX as I can, I figured I'd ask the community for help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a nutshell; I'm looking for a value in a (calculated) column in a date table. I need the value for Today. This seems to work, but feels too complex to just return a single value. Any advice would be appreciated. Thanks!&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;VAR endDate = CALCULATE( MAX(  'date'[dashboard_endDate]  ),  'date'[date]  = TODAY() )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 14:01:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-21T14:01:57Z</dc:date>
    <item>
      <title>Getting a single column value based on another (unique) column value - Optimize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1970672#M43278</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get a single column value from a table based on another (unique) column value. I've managed to get the value, but I have the feeling it's too clunky and could be made way simpler. Since my objective is not just to get something to work, but also to learn as much about DAX as I can, I figured I'd ask the community for help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a nutshell; I'm looking for a value in a (calculated) column in a date table. I need the value for Today. This seems to work, but feels too complex to just return a single value. Any advice would be appreciated. Thanks!&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;VAR endDate = CALCULATE( MAX(  'date'[dashboard_endDate]  ),  'date'[date]  = TODAY() )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 14:01:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1970672#M43278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-21T14:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a single column value based on another (unique) column value - Optimize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1970782#M43284</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , I think this is correct. Other way can be &lt;/P&gt;
&lt;P&gt;maxx(filter('Date', 'Date'[Date] = Today()), 'Date'[Dashboard_endDate])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 14:50:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1970782#M43284</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-07-21T14:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting a single column value based on another (unique) column value - Optimize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1973048#M43365</link>
      <description>&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The statement works indeed as expected. I'm just looking to see if I can optimize it. I find it weird I have to use a calculate' and 'MAX' (or maxx), if I just want to return a single value from a table where I know I'm not looking at a range of data but just a single row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data is very basic. It looks something like this. I just want to get the corresponding 'dashboard_endDate' for the current date so that I can automatically update data in my dashboard. (I can't use a relative date slicer for example, because information of the previous month can only be shown 'x' working days after the new month starts).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;dashboard_endDate&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-01&lt;/TD&gt;&lt;TD&gt;2021-04-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-02&lt;/TD&gt;&lt;TD&gt;2021-04-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-03&lt;/TD&gt;&lt;TD&gt;2021-04-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-04&lt;/TD&gt;&lt;TD&gt;2021-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-05&lt;/TD&gt;&lt;TD&gt;2021-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-06-06&lt;/TD&gt;&lt;TD&gt;2021-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might just be the way PowerBI/DAX works and I'm overthinking things. If that's the case, I'll stop looking for another solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 10:43:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-a-single-column-value-based-on-another-unique-column/m-p/1973048#M43365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-22T10:43:15Z</dc:date>
    </item>
  </channel>
</rss>

