<?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: Measure returning the correct value for one end of a relationship, and incorrect for the other end in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2681876#M80337</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="420454" data-lia-user-login="nfuids" class="lia-mention lia-mention-user"&gt;nfuids&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd warn you against using many-to-many without a thorough understanding of what problem this feature is trying to solve unless you want to be in for a surprise; in fact, many surprises. Many-to-many should be used for solving &lt;STRONG&gt;granularity issues ONLY&lt;/STRONG&gt;. Nothing else. Your problem clearly is not that. You should in all earnest create a bridge table in the usual manner and for one of the relationships enable the bidirectional filter. The bridge table should be hidden. This is Best Practice which you can find in Alberto's and Marco's works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes, I've been through the Book several times... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Resolved millions of DAX problems, so speaking from experience.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2022 13:44:34 GMT</pubDate>
    <dc:creator>daXtreme</dc:creator>
    <dc:date>2022-08-04T13:44:34Z</dc:date>
    <item>
      <title>Measure returning the correct value for one end of a relationship, and incorrect for the other end</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2676021#M79970</link>
      <description>&lt;P&gt;Hi folks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm rather new to Power BI, did a LOT of reading, almost all the learning path available and halfway through The Definitive Guide to DAX!&lt;BR /&gt;&lt;BR /&gt;I'm currently trying to create my first measure.&lt;BR /&gt;&lt;BR /&gt;My model is rather simple for now.. it consists of 1 table called 'UseCase' and a table called 'Feature'. There is a many-to-many relation between the two table since a UseCase acts as a parent that can have multiple features, but a feature could also be part of multiple use case.&lt;BR /&gt;&lt;BR /&gt;In the feature table, I have a column called "Status Raffinement" which might have "Pas démarré, En cours or Terminé" value. The measure I'm trying to create is to know the % of feature that are completed (Status = Terminé) for any given use case. So if a use case has 4 features and one of them is completed while the other 3 are either not started or in progress (Status = Pas démarré or En cours), the measure should say 25%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far so good, I did manage to do that which works good. When I put the UseCase and the measure in a table, I get the correct numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem arises when I use a matrix and put the feature too. The numbers are good at the use case level, but at the feature level, it repeat the same number. So if 25% of the features are completed, it will display 25% for each feature instead of 100% for those completed and 0% for those not started or in progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm pretty sure it has something to do with context, but I just can't figure it out.&lt;BR /&gt;&lt;BR /&gt;Here is my DAX Expression for the measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Pct Raffinement Termine := 
VAR nbrKidsTotal =
    COUNTROWS ( RELATEDTABLE ( Feature ) )
VAR nbrKidssRaffinementTermine =
    COUNTROWS (
        FILTER (  
            RELATEDTABLE ( Feature ), 
            Feature[Statut Raffinement] = "Terminé" 
        )
    )
VAR pctRaffinementTermine =
    DIVIDE ( nbrKidssRaffinementTermine, nbrKidsTotal, 0 )
RETURN
    pctRaffinementTermine&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below, you can see that one of the use case has 5 children, two of which are terminé, so that makes 40% and the value at the use-case level is correct. I would have expected to see 100% for the 2 completed features and 0% for the others. My guess is that I use RELATEDTABLE because the measure was initially intented for the Use-Case, but I don't see how I could make it work for both Use-Case and Feature at the sametime.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mart&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 15:23:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2676021#M79970</guid>
      <dc:creator>nfuids</dc:creator>
      <dc:date>2022-08-02T15:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Measure returning the correct value for one end of a relationship, and incorrect for the other end</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2679616#M80211</link>
      <description>&lt;P&gt;It seems I created a custom field instead of a measure!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code below works as expected, with a small error, but still, works pretty much ok!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Pct Realisation Termine = 
VAR nbrKidsTotal =
    COUNTROWS ( RELATEDTABLE ( Feature ) )
VAR nbrKidsTermine =
    COUNTROWS (
        FILTER ( 
            RELATEDTABLE ( Feature ), 
            Feature[Statut Réalisation] = "Terminé" 
        )
    )
VAR pctRealisationTermine =
    DIVIDE(nbrKidsTermine, nbrKidsTotal, 0 )
RETURN
    pctRealisationTermine&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The only thing now is that if there are no completed ("Terminé") items, the measure returns empty instead of 0.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 19:05:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2679616#M80211</guid>
      <dc:creator>nfuids</dc:creator>
      <dc:date>2022-08-03T19:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Measure returning the correct value for one end of a relationship, and incorrect for the other end</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2681548#M80316</link>
      <description>&lt;P&gt;Found out COUNTROWS returns BLANK() if there are no ROWS. So I Added + 0 at the end of the COUNTROWS function and fixed my problem!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 11:32:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2681548#M80316</guid>
      <dc:creator>nfuids</dc:creator>
      <dc:date>2022-08-04T11:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Measure returning the correct value for one end of a relationship, and incorrect for the other end</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2681876#M80337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="420454" data-lia-user-login="nfuids" class="lia-mention lia-mention-user"&gt;nfuids&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd warn you against using many-to-many without a thorough understanding of what problem this feature is trying to solve unless you want to be in for a surprise; in fact, many surprises. Many-to-many should be used for solving &lt;STRONG&gt;granularity issues ONLY&lt;/STRONG&gt;. Nothing else. Your problem clearly is not that. You should in all earnest create a bridge table in the usual manner and for one of the relationships enable the bidirectional filter. The bridge table should be hidden. This is Best Practice which you can find in Alberto's and Marco's works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes, I've been through the Book several times... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Resolved millions of DAX problems, so speaking from experience.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 13:44:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-returning-the-correct-value-for-one-end-of-a/m-p/2681876#M80337</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-04T13:44:34Z</dc:date>
    </item>
  </channel>
</rss>

