<?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: Using SELECTEDVALUE slicer and returning all results if nothing is selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1740209#M36151</link>
    <description>&lt;P&gt;&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;Thank you for this direction.&amp;nbsp; It did help answer my original question, but also illustrated I overlooked the impact of my data structure... not all records have a Category.&amp;nbsp; Explicitly defining all Categories when none are selected, as your solution does, implicitly filters those records with no Categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my presented DAX, [Hours] was a measure referencing my 'Data_ACTUAL' fact table, while 'Time Detail' relates to my (violation) Categories, which is a pivoted view since a single 'Data_ACTUAL' record could have more than one Category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the independent table (I originally called in a disconnected table) is potentially not going to work because of all the underlying visual calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously, I tried adding "dummy" records to my dataset and created all sorts of other unintended consequences.&lt;BR /&gt;Is there a way to define a slicer based on the underlying data, but append any categories missing from the dataset?&lt;BR /&gt;&lt;SPAN&gt;This approach would also mitigate cases where narrowly filtered scenarios would create missing Categories even if the Category exists in the (unfiltered) data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any further suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
    <pubDate>Tue, 23 Mar 2021 16:13:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-23T16:13:21Z</dc:date>
    <item>
      <title>Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1737882#M36085</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a slicer for my report legend and need to present all category options even if the data does not (yet) contain that scenario.&lt;/P&gt;&lt;P&gt;Here is an example of the slicer I am trying to populate.&amp;nbsp; Since we cannot color code slicer buttons (disappointing, &lt;A href="https://ideas.powerbi.com/ideas/idea/?ideaid=c4871122-4866-eb11-8fed-281878e608e9" target="_blank" rel="noopener"&gt;please up vote&amp;nbsp;my idea&lt;/A&gt;) you can see my current approach&amp;nbsp;is dependent on all categories being included.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently attempting to use a disconnected category table and SELECTEDVALUE with my measures.&amp;nbsp; I get the desired results if I make a selection.&amp;nbsp; However, I need to return all unfiltered results if no selection is made.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found &lt;A href="https://excelkingdom.blogspot.com/2019/10/how-to-get-all-selected-values-from.html" target="_blank" rel="noopener"&gt;this article&lt;/A&gt; that described how to get all selected values from a slicer.&amp;nbsp; Is it possible to do something similar and define &amp;lt;alternateResult&amp;gt; as if all options were selected?...&amp;nbsp;SELECTEDVALUE(&amp;lt;columnName&amp;gt;[, &amp;lt;alternateResult&amp;gt;])&lt;/P&gt;&lt;P&gt;Is there a better approach entirely to achieve my desired static slicer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a sample of my DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'SelectedValue' is my unconnected table.&lt;/P&gt;&lt;PRE&gt;Total Hours = &lt;BR /&gt;VAR selectedValue = SELECTEDVALUE( SelectedValue[Category Value] )&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;BR /&gt;    CALCULATE(&lt;BR /&gt;        [Hours] ,&lt;BR /&gt;        FILTER(&lt;BR /&gt;            ALL( 'Time Detail' ) ,&lt;BR /&gt;            'Time Detail'[Category Value] = selectedValue&lt;BR /&gt;            )&lt;BR /&gt;        )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 23:09:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1737882#M36085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-22T23:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1738188#M36094</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; If you are looking for a measure using unselected values using Independent table &lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=lOEW-YUrAbE" target="_blank"&gt;https://www.youtube.com/watch?v=lOEW-YUrAbE&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 03:44:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1738188#M36094</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-23T03:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1739680#M36124</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you followed the golden standard star schema design, you most likely wouldn't have to create a disconnected table for your slicer. And if your slicer were not disconnected (as it should not be), you wouldn't have to think about how to make your measure work as it would work out of the box, so to speak. To model your data properly, I'd recommend reading this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/star-schema" target="_blank"&gt;Understand star schema and the importance for Power BI - Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you had a proper star schema, your measure [Hours] would automatically do what you want it to do. It would react to selections in your slicer naturally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 13:26:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1739680#M36124</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-23T13:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1739805#M36134</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I am using a star schema design.&amp;nbsp; I continue to face two challenges with this model.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Category scenarios not yet represented in the data do not present in the slicer&lt;BR /&gt;Again, their absences is temporary and due to the reset of the accummulated data (for example, my week evaluations are not applicable until 7 days into the cycle.)&lt;/LI&gt;&lt;LI&gt;The selection of a slicer option removes the other presented slicer options&lt;BR /&gt;I am using the ChicletSlicer.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Am I missing something with your response?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am currently exploring&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;independent table suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 13:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1739805#M36134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-23T13:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1740209#M36151</link>
      <description>&lt;P&gt;&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;Thank you for this direction.&amp;nbsp; It did help answer my original question, but also illustrated I overlooked the impact of my data structure... not all records have a Category.&amp;nbsp; Explicitly defining all Categories when none are selected, as your solution does, implicitly filters those records with no Categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my presented DAX, [Hours] was a measure referencing my 'Data_ACTUAL' fact table, while 'Time Detail' relates to my (violation) Categories, which is a pivoted view since a single 'Data_ACTUAL' record could have more than one Category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the independent table (I originally called in a disconnected table) is potentially not going to work because of all the underlying visual calculations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously, I tried adding "dummy" records to my dataset and created all sorts of other unintended consequences.&lt;BR /&gt;Is there a way to define a slicer based on the underlying data, but append any categories missing from the dataset?&lt;BR /&gt;&lt;SPAN&gt;This approach would also mitigate cases where narrowly filtered scenarios would create missing Categories even if the Category exists in the (unfiltered) data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any further suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 16:13:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1740209#M36151</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-23T16:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using SELECTEDVALUE slicer and returning all results if nothing is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1744316#M36261</link>
      <description>&lt;P&gt;None of the responses resolved my issue, but below is the DAX I found that works.&amp;nbsp; The key was conditionally using the SELECTEDVALUE function ONLY IF there was a selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to those who responded or viewed my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Total Hours = &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; VAR selectedValue = SELECTEDVALUE( selectedValue[Category Value] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;   RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    IF(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      ISBLANK( selectedValue ) ,        // Checks if there is a slicer selection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      CALCULATE(                      // If no slicer selection, routine SUM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        SUM( 'Time Detail'[Total Hours] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      ) ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      CALCULATE(                      // If slicer selection, uses SELECTEDVALUE to filter the [Category Value]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        SUM( 'Time Detail'[Total Hours] ) ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        FILTER(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;          'Violation Detail' ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;          'Category Detail'[Category Value] = selectedValue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;      )&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Mar 2021 03:04:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SELECTEDVALUE-slicer-and-returning-all-results-if-nothing/m-p/1744316#M36261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-25T03:04:04Z</dc:date>
    </item>
  </channel>
</rss>

