<?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: Filter on visuals based on selected value but different logic in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4592755#M175883</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could it be related with your filters, it shloud be AND, isnt't it ?, so :&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[QuestionID]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SelectedQuestion &lt;STRONG&gt;&amp;amp;&amp;amp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[Value_Or_OptionHU]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SelectedValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;With a comma you get the equivalent of OR.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does it solve your problem ?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 03 Mar 2025 11:01:28 GMT</pubDate>
    <dc:creator>AilleryO</dc:creator>
    <dc:date>2025-03-03T11:01:28Z</dc:date>
    <item>
      <title>Filter on visuals based on selected value but different logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4590084#M175812</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set of customer satisfaction surveys where data is organized according to the below picture. Answer headers contains info about 1 fill of the survey, answer details holding the per question data.&lt;/P&gt;&lt;P&gt;We are showing every question of the survey in a separate visual, using the answer__details / Value_or_OptionHU field.&lt;BR /&gt;&lt;BR /&gt;I would like to achive a filtering where user clicks on some value of a visual (i.e. one slice of a pie chart) then all other visuals/questions on the page are being filtered to show answers where the users gave the same answer for the selected corresponding question.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;Question 1: How would you rate us?&amp;nbsp;&lt;BR /&gt;Options: 1,2,3,4,5&lt;BR /&gt;If i click on the pie chart's slice that shows the 5 ratings, the other visuals of other questions should show the answers (of other questions) where the answer of the same user for the 1st question was 5.&lt;BR /&gt;&lt;BR /&gt;Here are my tables:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My approach was to find all AnswerIDs where the same answer for the same question was given and filter the visuals of the page to those, but cannot make it work....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FilteredAnswerIDs =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;SelectedQuestion&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;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[QuestionID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;SelectedValue&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;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[Value_Or_OptionHU]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[AnswerID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[QuestionID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SelectedQuestion&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[Value_Or_OptionHU]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SelectedValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;I would appreaciate any suggestion &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Many thanks!&lt;/DIV&gt;&lt;DIV&gt;Adam&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Feb 2025 13:13:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4590084#M175812</guid>
      <dc:creator>szoradam</dc:creator>
      <dc:date>2025-02-28T13:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on visuals based on selected value but different logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4590926#M175826</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2025 00:04:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4590926#M175826</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-01T00:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on visuals based on selected value but different logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4592755#M175883</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could it be related with your filters, it shloud be AND, isnt't it ?, so :&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[QuestionID]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SelectedQuestion &lt;STRONG&gt;&amp;amp;&amp;amp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;answer__details&lt;/SPAN&gt;&lt;SPAN&gt;[Value_Or_OptionHU]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SelectedValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;With a comma you get the equivalent of OR.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does it solve your problem ?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Mar 2025 11:01:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4592755#M175883</guid>
      <dc:creator>AilleryO</dc:creator>
      <dc:date>2025-03-03T11:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on visuals based on selected value but different logic</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4594810#M175951</link>
      <description>&lt;P&gt;Sorry if my question was not clear enough.&lt;BR /&gt;Probably this code of my measure will be more speachful for you:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CountOfResults = 
VAR mySelectedQuestionID = SELECTEDVALUE(answer__details[QuestionID]) 
VAR mySelectedValue = SELECTEDVALUE(answer__details[Value_Or_OptionHU])

VAR SelectedAnswerIDs = IF (
    NOT(ISBLANK(mySelectedQuestionID)) &amp;amp;&amp;amp; NOT(ISBLANK(mySelectedValue)),
    FILTER(
        ALL(answer__details),
        answer__details[QuestionID] = mySelectedQuestionID &amp;amp;&amp;amp;
        answer__details[Value_Or_OptionHU] = mySelectedValue
    ),
    ALL(answer__details)
)

RETURN
    COUNTROWS(
        FILTER(
            ALL('answer__details'), 
            NOT(ISBLANK('answer__details'[value_or_optionhu])) &amp;amp;&amp;amp;
            'answer__details'[AnswerID] IN 
                 SELECTCOLUMNS(SelectedAnswerIDs, "AnswerID", answer__details[AnswerID])
            )
        )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;What i would like to achieve is based on the selected values in the context, i get a list of answerIDs (so far it is working), and then I would like to count the rows of my 'answer__details' table where the answerID is in the list of the IDs I previously calculated. Chatgpt is not able to help we are going in circles as suggesting to use selectcolumn(), values(), but cannot manage to get the IDs out of my variable in a proper way to be able to use with the "IN" condition.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 11:34:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-visuals-based-on-selected-value-but-different-logic/m-p/4594810#M175951</guid>
      <dc:creator>szoradam</dc:creator>
      <dc:date>2025-03-04T11:34:02Z</dc:date>
    </item>
  </channel>
</rss>

