<?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: Hide empty fact rows while using SCD dimension measure that needs multiple filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166608#M50230</link>
    <description>&lt;P&gt;Hi Alexis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's not exactly what I need, I think my sample file was not build very well to show what I mean - I'll try it with following changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The orders 1,2,3 and 7 are all orders of product "A" (table "Initial Situaiton Order").&lt;/P&gt;&lt;P&gt;Product "A" had 10 pieces on stock until 2021-05-31 (highlihted red), which changed to 5 pieces as of 2021-06-01 (highlighted yellow).&lt;/P&gt;&lt;P&gt;The connection between fact and dimension is established via the ProductID (see arrows); as it is a slowly changing dimension, attributes should usually be shown with the as-of situation at a certain date in history. I have added an attribute "Supplier" for reference. Thus, OrderId 1,2 and 7 are shown with supplier "Sup1" that was valid until 2021-05-31 becuase the order date was dated before that; OrderId 3 is shown with supplier "Sup2" that was valid after or on 2021-06-01 (all marked in green rectangle).&lt;/P&gt;&lt;P&gt;In this special case of stock values I need to have a different approach, however. Here, I always need the current as-is situation, which is labeled with the "IsActive"-Flag (1 = current). Thus, I somehow need to keep the above logic but bypass it for this measure - In all four rows in the table "Order - wrong stock values, no empty lines" there should be stock value 5 (as shown with green arrow).&lt;/P&gt;&lt;P&gt;Here you can find the changed file: &lt;A href="https://jckholding-my.sharepoint.com/:u:/g/personal/k_barlage_encuble_de/EVoe_tIN0xFBmPCnKOffg3MBVCMRXhTkv7V1FsQRRIJwDg?e=CPpOQK" target="_self"&gt;PBIX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this explanation helps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Nov 2021 16:03:30 GMT</pubDate>
    <dc:creator>KaySunset</dc:creator>
    <dc:date>2021-11-01T16:03:30Z</dc:date>
    <item>
      <title>Hide empty fact rows while using SCD dimension measure that needs multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166033#M50187</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue with the use of a Slowly Changing Dimension (SCD) with multiple fact tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume a star schema model, in a very simple form with two fact tables and one product SCD. Within the product dimension, there's a stock value column. I created a measure [ProductStockValue] to be able to show the &lt;U&gt;&lt;STRONG&gt;current&lt;/STRONG&gt; &lt;/U&gt;product stock value. I need this measure to work in various combinations, e.g. either in combination with Orders or with Invoices - always depending on the current question to analyze. This has been solved with a Switch/IsFiltered combination (see&lt;LI-MESSAGE title="CROSSFILTER to use one dimension measure with multiple fact analyses" uid="2163465" url="https://community.powerbi.com/t5/DAX-Commands-and-Tips/CROSSFILTER-to-use-one-dimension-measure-with-multiple-fact/m-p/2163465#U2163465" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; as reference that has been solved perfectly by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;, thanks again).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that in the above mentioned topic, I have a far easier example than another use case that I have. There is an SCD, where I also use an [IsActive] filter for the dimension-based measure (that is used to display only current Stocks). In combination with the Switch/IsFiltered function this does not work properly: Whenever the stock value at a certain point of time of the order/invoice is not valid any more, it will not be shown.&lt;/P&gt;&lt;P&gt;When I remove the Switch/Isfiltered part I do get correct stock values, but there are many empty fact lines, as all products stock values are always shown.Those I need to be hidden.&lt;/P&gt;&lt;P&gt;Is there any solution to a use of Product SCD with mutliple facts and still have all above functionalities?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample file: &lt;A href="https://jckholding-my.sharepoint.com/:u:/g/personal/k_barlage_encuble_de/EVoe_tIN0xFBmPCnKOffg3MBVCMRXhTkv7V1FsQRRIJwDg?e=OvKkWX" target="_self"&gt;PBIX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Kathrin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 10:30:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166033#M50187</guid>
      <dc:creator>KaySunset</dc:creator>
      <dc:date>2021-11-01T10:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hide empty fact rows while using SCD dimension measure that needs multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166556#M50222</link>
      <description>&lt;P&gt;Does this work for what you're after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ProductStockValue_AO =
CALCULATE (
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Order' ), CALCULATE ( SUM ( 'Product'[StockValue] ), 'Order' ),
        ISFILTERED ( 'Invoice' ), CALCULATE ( SUM ( 'Product'[StockValue] ), Invoice ),
        SUM ( 'Product'[StockValue] )
    ),
    'Product'[IsActive] = 1
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Nov 2021 15:20:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166556#M50222</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-11-01T15:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hide empty fact rows while using SCD dimension measure that needs multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166608#M50230</link>
      <description>&lt;P&gt;Hi Alexis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's not exactly what I need, I think my sample file was not build very well to show what I mean - I'll try it with following changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The orders 1,2,3 and 7 are all orders of product "A" (table "Initial Situaiton Order").&lt;/P&gt;&lt;P&gt;Product "A" had 10 pieces on stock until 2021-05-31 (highlihted red), which changed to 5 pieces as of 2021-06-01 (highlighted yellow).&lt;/P&gt;&lt;P&gt;The connection between fact and dimension is established via the ProductID (see arrows); as it is a slowly changing dimension, attributes should usually be shown with the as-of situation at a certain date in history. I have added an attribute "Supplier" for reference. Thus, OrderId 1,2 and 7 are shown with supplier "Sup1" that was valid until 2021-05-31 becuase the order date was dated before that; OrderId 3 is shown with supplier "Sup2" that was valid after or on 2021-06-01 (all marked in green rectangle).&lt;/P&gt;&lt;P&gt;In this special case of stock values I need to have a different approach, however. Here, I always need the current as-is situation, which is labeled with the "IsActive"-Flag (1 = current). Thus, I somehow need to keep the above logic but bypass it for this measure - In all four rows in the table "Order - wrong stock values, no empty lines" there should be stock value 5 (as shown with green arrow).&lt;/P&gt;&lt;P&gt;Here you can find the changed file: &lt;A href="https://jckholding-my.sharepoint.com/:u:/g/personal/k_barlage_encuble_de/EVoe_tIN0xFBmPCnKOffg3MBVCMRXhTkv7V1FsQRRIJwDg?e=CPpOQK" target="_self"&gt;PBIX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this explanation helps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 16:03:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166608#M50230</guid>
      <dc:creator>KaySunset</dc:creator>
      <dc:date>2021-11-01T16:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hide empty fact rows while using SCD dimension measure that needs multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166813#M50244</link>
      <description>&lt;P&gt;This is hard since the ProductID you're relating tables with doesn't correspond to a single product but a product at a certain time. You might want to re-think your model to make this work more easily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is as close as I managed to get. Not pretty.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ProductStockValue_AO = 
VAR ActiveProds =
    CALCULATETABLE (
        VALUES ( 'Product'[ProductID] ),
        FILTER ( ALLEXCEPT ( 'Product', 'Product'[product] ), 'Product'[IsActive] = 1 )
    )
VAR OrderProds = ALLSELECTED ( 'Order'[ProductID] )
VAR InvoiceProds = ALLSELECTED ( 'Invoice'[ProductID] )
RETURN
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Order' ),
            IF (
                NOT ISEMPTY ( 'Order' ),
                CALCULATE (
                    SUM ( 'Product'[StockValue] ),
                    REMOVEFILTERS (),
                    'Product'[ProductID] IN INTERSECT ( ActiveProds, OrderProds )
                )
            ),
        ISFILTERED ( Invoice ),
            IF (
                NOT ISEMPTY ( 'Invoice' ),
                CALCULATE (
                    SUM ( 'Product'[StockValue] ),
                    REMOVEFILTERS (),
                    'Product'[ProductID] IN INTERSECT ( ActiveProds, InvoiceProds )
                )
            ),
        SUM ( 'Product'[StockValue] )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 18:15:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2166813#M50244</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-11-01T18:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hide empty fact rows while using SCD dimension measure that needs multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2168318#M50308</link>
      <description>&lt;P&gt;Hi Alexis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was afraid that changing the data model would be the best solution &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Your suggestion works for the order part, but the invoice table shows a stock value of 10 for all products, also those that should be showing 5. But as you said, it's not pretty and considering I have even more fact tables and this is not the only measure effected, this does not make much sense.&lt;/P&gt;&lt;P&gt;So there's no need to go into further analysis, I'll change the datamodel after all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This still helped me a lot to dig deeper into DAX - thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Kathrin&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 11:52:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Hide-empty-fact-rows-while-using-SCD-dimension-measure-that/m-p/2168318#M50308</guid>
      <dc:creator>KaySunset</dc:creator>
      <dc:date>2021-11-02T11:52:24Z</dc:date>
    </item>
  </channel>
</rss>

