<?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: Mesure dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2229544#M53171</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329393" data-lia-user-login="Nihed" class="lia-mention lia-mention-user"&gt;Nihed&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly, you need to change the type of date value from text to Date type.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;then, there are something need to be checked,&lt;/P&gt;
&lt;P&gt;(1) what's the SUI table? This table doesn't exist in the sample file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) In your rules, please see the picture bellow, the logic of 1st part is same and I've wrote the dax expression for this part, please check whether the result is right for you. Kindly note: change the type to date then test the measure.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _value = MIN(PPM[Steps])
return SWITCH(TRUE(),
_value="1 - Planned/Not Started",0,
_value="2 - TORs received/under review",AVERAGEX(ALL(PPM),PPM[TORs completed]-PPM[TORs received]),
_value="3 - Open for Competition",AVERAGEX(ALL(PPM),PPM[Closes on]-PPM[Posted on])
)&lt;/LI-CODE&gt;
&lt;P&gt;And the logic of &lt;STRONG&gt;2&lt;/STRONG&gt;nd part, I'm not sure what the redlined sentence means. Could you explain them?&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 07:10:46 GMT</pubDate>
    <dc:creator>v-xiaotang</dc:creator>
    <dc:date>2021-12-09T07:10:46Z</dc:date>
    <item>
      <title>Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2223081#M52827</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Someone can give me an idea how I can do this mesure in Dax please&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mesure=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = " &lt;/STRONG&gt;&lt;STRONG&gt;1-Planned/Not Started " then 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = "2 - TORs received/under review” then AVERAGE(TORs Completed - TORs received)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = " &lt;/STRONG&gt;&lt;STRONG&gt;3-Open for Competition " then AVERAGE(Closes on - Posted on)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = "4- Technical Evaluations" then AVERAGE(Technical Evaluation Completed - Closes On)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = "5 - Financial Negotiations" then AVERAGE(Negotiation Completed - Technical Evaluation Completed)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = " &lt;/STRONG&gt;&lt;STRONG&gt;6-Procurement Board " then AVERAGE(PB Date - Negotiation Completed)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF Steps = "7-Legal Review" then AVERAGE(Reviewed by LEG - PB Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF 'PPM'[Step] = "8-Signature" AND 'SUI'[Reference] = "RFQ*" then AVERAGE(STEP DURATION = 'SUI'[Date Signature] - 'SUI'[Reception de la demande])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF 'PPM'[Step] = "9-Finalised" then STEP DURATION = SUM(each STEP DURATION from TORs to Signature)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:31:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2223081#M52827</guid>
      <dc:creator>Nihed</dc:creator>
      <dc:date>2021-12-06T14:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2224816#M52933</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;The function that you are looking for is SWITCH combined with TRUE.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;My example data:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example measure:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Switch_example = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_value&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Switch example'[Selection]&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_value&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"1-Planned/Not Started"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_value&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"2 - TORs received/under review"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;AVERAGE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Matrix example'[Value]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_value&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;SPAN&gt;"3-Open for Competition"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//Use the same structure of (_value ="what the value should match",what values is returned if the match is okay) for further steps&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;End result:&lt;BR /&gt;&lt;/STRONG&gt;&lt;img /&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;STRONG&gt;Things to note:&lt;BR /&gt;&lt;/STRONG&gt;If you need to do addition and substraction calculations combined with average you should do them separately before AVERAGE e.g. in a calculated column.&lt;BR /&gt;&lt;BR /&gt;Hopefully this helps to solve your issue and if it does consider accepting this as a solution!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Dec 2021 08:49:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2224816#M52933</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2021-12-07T08:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2224960#M52945</link>
      <description>&lt;P&gt;&lt;SPAN class="ng-star-inserted"&gt;thank you for your return&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="ng-star-inserted"&gt;what you have done is calculate each FI separately while&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="ng-star-inserted"&gt;what I sent is a single measure that contains all this calculation I send you the data table in a pbix to explain my need&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the need is to calculate this KPI:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The example data in pbix in this link :&lt;/P&gt;&lt;P&gt;&lt;A title="KPI.NEED" href="https://we.tl/t-ODV6VPsZhm" target="_self"&gt;https://we.tl/t-ODV6VPsZhm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="ng-star-inserted"&gt;Thanks again&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 09:49:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2224960#M52945</guid>
      <dc:creator>Nihed</dc:creator>
      <dc:date>2021-12-07T09:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225094#M52955</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Unfortunately due to information security reasons I can't view your example data. I am a bit perplexed as to why the switch measure doesn't work. The logic behind the measure is that if the source column's value is something e.g. "1&lt;SPAN&gt;-Planned/Not Started&lt;/SPAN&gt;" then the measure returns value after the next comma. So in essence it functions like this:&lt;BR /&gt;&lt;BR /&gt;var example = max(here you should refrer to the source fied e.g. [Steps]) return&lt;BR /&gt;&lt;BR /&gt;Switch(true(),&lt;BR /&gt;if variable value =&amp;nbsp; "1&lt;SPAN&gt;-Planned/Not Started&lt;/SPAN&gt;" then return this&lt;BR /&gt;if variable value = "2 - TORs received/under review" then return this&lt;/P&gt;&lt;P&gt;... and so on)&lt;BR /&gt;&lt;BR /&gt;I am not sure this clarifies the logic or if I have misunderstood something.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 10:46:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225094#M52955</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2021-12-07T10:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225237#M52961</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The problem that I can’t average because fields like following :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;for example I have&amp;nbsp;&lt;STRONG&gt;AVERAGE(TORs Completed - TORs received)&amp;nbsp; how can i do it?:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 11:44:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225237#M52961</guid>
      <dc:creator>Nihed</dc:creator>
      <dc:date>2021-12-07T11:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225261#M52962</link>
      <description>&lt;P&gt;I see now. Like I mentioned in things to note, in these kind of cases I would create a calculated column for the substraction operation and then take The average from this calculated column. This is due to The fact that AVERAGE only accepts column as The value. For now I think this is the most straightforward approach.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 11:54:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225261#M52962</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2021-12-07T11:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225839#M52989</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329393" data-lia-user-login="Nihed" class="lia-mention lia-mention-user"&gt;Nihed&lt;/a&gt;&amp;nbsp;provide sample data and expected output.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 15:48:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225839#M52989</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-07T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225880#M52991</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I send you the link of the example I am working you can see the data in the pbix&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="KPI need" href="https://we.tl/t-VMz3BFCyNS" target="_self"&gt;https://we.tl/t-VMz3BFCyNS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my need is to calculate the following KPIs if you can help me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 15:53:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2225880#M52991</guid>
      <dc:creator>Nihed</dc:creator>
      <dc:date>2021-12-07T15:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2229544#M53171</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329393" data-lia-user-login="Nihed" class="lia-mention lia-mention-user"&gt;Nihed&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly, you need to change the type of date value from text to Date type.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;then, there are something need to be checked,&lt;/P&gt;
&lt;P&gt;(1) what's the SUI table? This table doesn't exist in the sample file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) In your rules, please see the picture bellow, the logic of 1st part is same and I've wrote the dax expression for this part, please check whether the result is right for you. Kindly note: change the type to date then test the measure.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _value = MIN(PPM[Steps])
return SWITCH(TRUE(),
_value="1 - Planned/Not Started",0,
_value="2 - TORs received/under review",AVERAGEX(ALL(PPM),PPM[TORs completed]-PPM[TORs received]),
_value="3 - Open for Competition",AVERAGEX(ALL(PPM),PPM[Closes on]-PPM[Posted on])
)&lt;/LI-CODE&gt;
&lt;P&gt;And the logic of &lt;STRONG&gt;2&lt;/STRONG&gt;nd part, I'm not sure what the redlined sentence means. Could you explain them?&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 07:10:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2229544#M53171</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2021-12-09T07:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Mesure dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2251066#M54197</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329393" data-lia-user-login="Nihed" class="lia-mention lia-mention-user"&gt;Nihed&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I notice that this post is inactive, may I know if you have solved&amp;nbsp;this question with help? If you have solved the question,&amp;nbsp;&lt;U&gt;you can accept the answer helpful as the solution&lt;/U&gt;&amp;nbsp;&lt;STRONG&gt;or&lt;/STRONG&gt;&amp;nbsp;&lt;U&gt;share you method and accept it as solution&lt;/U&gt;, thanks for your contribution to improve Power BI.&lt;/P&gt;
&lt;P&gt;If you need more help, please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 05:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Mesure-dax/m-p/2251066#M54197</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2021-12-22T05:14:59Z</dc:date>
    </item>
  </channel>
</rss>

