<?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: How to return a value from row context of matrix with a blank value (SELECTEDVALUE) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2722655#M83091</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, if there is no data in&amp;nbsp;&lt;SPAN&gt;'ACDOCA_GL Actuals'&lt;/SPAN&gt;&lt;SPAN&gt;[GL Account] for Jan for that CostCentre, then the expression&amp;nbsp;SELECTEDVALUE('ACDOCA_GL Actuals'[GL Account]) will return BLANK. So the overall CALCULATE expression will return BLANK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would guess that the field that you are using in the matrix for GLAccount is 'ACDOCA_GL Actuals'[GL Account].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To solve this, I would suggest creating and using a dimension table for GLAcount, and using the dimension field in the matrix. That way there will be a value for GLAccount for Jan so that the expression&amp;nbsp;SELECTEDVALUE('dimAccounts'[GL Account]) will return a value, which will allow the CALCULATE expression to retrieve the correct value for [Plan Measure] for that account for Jan.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You will need to change [Plan Measure] to&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Plan Measure = 
    calculate(
        sum('Plan Data Tabular'[Amount $]),
        'Plan Data Tabular'[Coa Code for Mapping] = SELECTEDVALUE('dimAccount'[GL Account]),
        'Plan Data Tabular'[Cost Center Cd Adjusted for Plan Blanks] = SELECTEDVALUE('dimAccount'[Cost Center])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 08:59:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-24T08:59:25Z</dc:date>
    <item>
      <title>How to return a value from row context of matrix with a blank value (SELECTEDVALUE)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2721725#M83031</link>
      <description>&lt;P&gt;I am attempting to lookup a value from one table to another. I have tried many different methods of relating the data including a mapping table of distinct values, many-many relationships, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables, Actuals and Plan. I want to relate them by account # and cost center #. The core issue is that there are some instances where there have been NO actuals on an account for a cost center but there is a PLAN value on that account/cost center. The PLAN # is the same for each cost center for every month.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to use this measure to look up the value from the plan table, but the selected value fails when there is no value in the row, see screenshot below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see for Month 2 the measure happily returns the PLAN value because selected value is satisfied with the row context having a value. However January plan is not showing up even though the plan # on that cost center is the exact same, I believe it because selected value isn't actually grabbing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Plan Measure = &lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Plan Data Tabular'&lt;/SPAN&gt;&lt;SPAN&gt;[Amount $]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'Plan Data Tabular'&lt;/SPAN&gt;&lt;SPAN&gt;[Coa Code for Mapping]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ACDOCA_GL Actuals'&lt;/SPAN&gt;&lt;SPAN&gt;[GL Account]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Plan Data Tabular'&lt;/SPAN&gt;&lt;SPAN&gt;[Cost Center Cd Adjusted for Plan Blanks]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ACDOCA_GL Actuals'&lt;/SPAN&gt;&lt;SPAN&gt;[Cost Center]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I apologize if this explanation is convoluted but I think the screenshot is quite clear, how do I use DAX to write a measure that forces a lookup by the cost center value on the left, even if there is no value for that month in the matrix.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Aug 2022 00:54:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2721725#M83031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-24T00:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a value from row context of matrix with a blank value (SELECTEDVALUE)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2722655#M83091</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, if there is no data in&amp;nbsp;&lt;SPAN&gt;'ACDOCA_GL Actuals'&lt;/SPAN&gt;&lt;SPAN&gt;[GL Account] for Jan for that CostCentre, then the expression&amp;nbsp;SELECTEDVALUE('ACDOCA_GL Actuals'[GL Account]) will return BLANK. So the overall CALCULATE expression will return BLANK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would guess that the field that you are using in the matrix for GLAccount is 'ACDOCA_GL Actuals'[GL Account].&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To solve this, I would suggest creating and using a dimension table for GLAcount, and using the dimension field in the matrix. That way there will be a value for GLAccount for Jan so that the expression&amp;nbsp;SELECTEDVALUE('dimAccounts'[GL Account]) will return a value, which will allow the CALCULATE expression to retrieve the correct value for [Plan Measure] for that account for Jan.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You will need to change [Plan Measure] to&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Plan Measure = 
    calculate(
        sum('Plan Data Tabular'[Amount $]),
        'Plan Data Tabular'[Coa Code for Mapping] = SELECTEDVALUE('dimAccount'[GL Account]),
        'Plan Data Tabular'[Cost Center Cd Adjusted for Plan Blanks] = SELECTEDVALUE('dimAccount'[Cost Center])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 08:59:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2722655#M83091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-24T08:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a value from row context of matrix with a blank value (SELECTEDVALUE)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2749774#M84802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;
&lt;P&gt;I just want to confirm if you resolved this issue? If yes,&amp;nbsp;&lt;U&gt;you can accept the answer helpful as the solution&lt;/U&gt;&amp;nbsp;&lt;STRONG&gt;or&lt;/STRONG&gt;&amp;nbsp;&lt;U&gt;share you method and accept it as solution&lt;/U&gt;, thanks for your contribution to improve Power BI.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you need more help, please let me know.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 09:00:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-return-a-value-from-row-context-of-matrix-with-a-blank/m-p/2749774#M84802</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-09-06T09:00:34Z</dc:date>
    </item>
  </channel>
</rss>

