<?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 Filter Context - Importance of HASONEVALUE with VALUES function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833203#M184600</link>
    <description>&lt;P&gt;Error -&amp;nbsp;a table of multiple VALUES was supplied when single value was expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dax -&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sales commission =&lt;/SPAN&gt; &lt;SPAN&gt;[Revenue]&lt;/SPAN&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"United States"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0.15&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0.1&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DAX -&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sales commission =&lt;/SPAN&gt; &lt;SPAN&gt;[Revenue]&lt;/SPAN&gt;&lt;SPAN&gt; * &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"United States"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0.15&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0.1&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;now, no error&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 23 Sep 2025 09:34:13 GMT</pubDate>
    <dc:creator>Sania-F</dc:creator>
    <dc:date>2025-09-23T09:34:13Z</dc:date>
    <item>
      <title>Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833203#M184600</link>
      <description>&lt;P&gt;Error -&amp;nbsp;a table of multiple VALUES was supplied when single value was expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dax -&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sales commission =&lt;/SPAN&gt; &lt;SPAN&gt;[Revenue]&lt;/SPAN&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"United States"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0.15&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0.1&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DAX -&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sales commission =&lt;/SPAN&gt; &lt;SPAN&gt;[Revenue]&lt;/SPAN&gt;&lt;SPAN&gt; * &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;"United States"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0.15&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0.1&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;now, no error&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Sep 2025 09:34:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833203#M184600</guid>
      <dc:creator>Sania-F</dc:creator>
      <dc:date>2025-09-23T09:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833230#M184603</link>
      <description>&lt;P&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales Territory'&lt;/SPAN&gt;&lt;SPAN&gt;[Country]) returns a table and you cannot compare a table to a value like "United States"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HASONEVALUE checks that VALUES returns a single value (a table of one row and one column) and in that case DAX turrns that table (of one row and one column) into a single value so it works&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helped, please consider giving kudos and mark as a solution&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273" data-lia-user-login="me" class="lia-mention lia-mention-user"&gt;me&lt;/a&gt; in replies or I'll lose your thread&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Want to check your DAX skills? &lt;A href="https://www.linkedin.com/company/kubisco/" target="_blank"&gt;Answer my biweekly DAX challenges on the kubisco Linkedin page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Consider voting &lt;A href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/Power-BI-Filter-Pane-as-an-icon-on-the-right-side-bar-in-on/idi-p/4728588" target="_blank"&gt;this Power BI idea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Francesco Bergamaschi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MBA, M.Eng, M.Econ, Professor of BI&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 09:50:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833230#M184603</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-09-23T09:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833510#M184615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518975" data-lia-user-login="Sania-F" class="lia-mention lia-mention-user"&gt;Sania-F&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You’re seeing that error because VALUES('Sales Territory'[Country]) returns a &lt;EM&gt;table&lt;/EM&gt; of distinct countries in the current filter context.&lt;/STRONG&gt; When there’s more than one country in scope (totals, multi-select slicers, unfiltered visuals, etc.), comparing that table to the string "United States" makes DAX throw “a table of multiple values was supplied…”. HASONEVALUE() suppresses the error by short-circuiting when there isn’t exactly one country-but it also returns blank in those cases, which often gives wrong totals.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use SELECTEDVALUE and aggregate per country with SUMX so totals add up:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales Commission :=
SUMX(
    VALUES('Sales Territory'[Country]),
    [Revenue] *
        IF( SELECTEDVALUE('Sales Territory'[Country]) = "United States", 0.15, 0.10 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 14:40:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4833510#M184615</guid>
      <dc:creator>tayloramy</dc:creator>
      <dc:date>2025-09-23T14:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4834209#M184638</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518975" data-lia-user-login="Sania-F" class="lia-mention lia-mention-user"&gt;Sania-F&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;I would also take a moment to thank&amp;nbsp;&lt;/SPAN&gt;&lt;A title="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1231947" href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1231947" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN data-teams="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 10:08:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4834209#M184638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-09-24T10:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4838554#M184779</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518975" data-lia-user-login="Sania-F" class="lia-mention lia-mention-user"&gt;Sania-F&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 05:01:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4838554#M184779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-09-30T05:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context - Importance of HASONEVALUE with VALUES function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4842818#M184866</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518975" data-lia-user-login="Sania-F" class="lia-mention lia-mention-user"&gt;Sania-F&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Oct 2025 05:54:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-Importance-of-HASONEVALUE-with-VALUES-function/m-p/4842818#M184866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-10-06T05:54:56Z</dc:date>
    </item>
  </channel>
</rss>

