<?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: Trying to calculate % On Time Delivery for our suppliers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2533194#M71100</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try formulas as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Early/Ontime records = CALCULATE(COUNT('Table'[Supplier Name]),FILTER(ALLEXCEPT('Table','Table'[Supplier Name]),'Table'[Status] in {"Early","OnTime"}))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Total records = CALCULATE(COUNT('Table'[Supplier Name]),ALLEXCEPT('Table','Table'[Supplier Name]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Percentage = 'Table'[Early/Ontime records]/'Table'[Total records] &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check my sample file for more details.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 11:18:52 GMT</pubDate>
    <dc:creator>v-easonf-msft</dc:creator>
    <dc:date>2022-05-23T11:18:52Z</dc:date>
    <item>
      <title>Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2524024#M70509</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I need to let everyone know I am very new to DAX, so please talk slow.....&amp;nbsp; &amp;nbsp;lol&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that contains a list of all suppliers and multiple&amp;nbsp; receipt dates and I want to calculate the percentage of reciepts that are on Time or Early per supplier based on the total count of the suppliers receipts&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I addaed a new column titled "Reciept date - Due Date" to calculate how many days before or after the Due date the shippment arrived.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I added a status colum and defined the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Status = IF('Supplier OTD'[Reciept date-Due Date] &amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;4,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Late",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF('Supplier OTD'[Reciept date-Due Date] &amp;lt;-4,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Early",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Ontime"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Where I'm stumped is how to count the total reciepts per supplier and show the percentage that were Ontime or Early. (Eaxmple:&amp;nbsp; &amp;nbsp;Totol of 10 receipts for supplier X,&amp;nbsp; 6 were ONTIME, 1 was EARLY and 3 were LATE = 70% Ontime or Early)&amp;nbsp; &amp;nbsp; I figure I can use a slicer i my visual to filter for a specific time period or suppier .&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have been watching youtube videos try to figure this out but cant really find a similar situation.....&amp;nbsp; Any help you can provide is greatly appreciated!&amp;nbsp; ☺&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rick&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 17:22:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2524024#M70509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-18T17:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2533194#M71100</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try formulas as below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Early/Ontime records = CALCULATE(COUNT('Table'[Supplier Name]),FILTER(ALLEXCEPT('Table','Table'[Supplier Name]),'Table'[Status] in {"Early","OnTime"}))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Total records = CALCULATE(COUNT('Table'[Supplier Name]),ALLEXCEPT('Table','Table'[Supplier Name]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Percentage = 'Table'[Early/Ontime records]/'Table'[Total records] &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check my sample file for more details.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 11:18:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2533194#M71100</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-05-23T11:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2534137#M71151</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I believe you hould have separate date table and dimension table for Suppliers. Both of these tables only ontain unique values and they have a relationship to your fact table, connecting on both date and Supplier. I will attach a different file that shows a modeling set up like I am referring to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To count the early on times a measure can be used.&lt;/P&gt;&lt;P&gt;On Time/Early=&lt;BR /&gt;SUMX ( SUMMARIZE ( 'Table', 'Table'[Supplier Name],'Table'[Due Date] ,&lt;BR /&gt;'Table'[Reciept Date]), CALCULATE ( IF ( INT('Table'[Reciept Date] - 'Table'[Due Date]&amp;gt; 1, 1 ) ) ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Amt= COUNTROWS('Table')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% on time = DIVIDE([On time/Early], Total Amt],0)&lt;/P&gt;&lt;P&gt;&lt;A title="Example Model" href="https://drive.google.com/file/d/1QgEO4YwQQh2lqtXk1hnwQYVBuv6BbKcS/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1QgEO4YwQQh2lqtXk1hnwQYVBuv6BbKcS/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is date table code below. You can go to Modeling&amp;gt;New Table&lt;/P&gt;&lt;P&gt;Dates =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Specify a start date and end date&lt;/P&gt;&lt;P&gt;VAR StartDate = Date(2021,1,1)&lt;/P&gt;&lt;P&gt;VAR EndDate = Today() + 243&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR FiscalMonthEnd = 12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Generate a base table of dates&lt;/P&gt;&lt;P&gt;VAR BaseTable = Calendar(StartDate, EndDate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add the Year for each individual date&lt;/P&gt;&lt;P&gt;VAR Years = ADDCOLUMNS(BaseTable,"Year",YEAR([Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add the calendar month and other month related data for each date&lt;/P&gt;&lt;P&gt;VAR Months = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Years,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Month",MONTH([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Year and Month Number",FORMAT([Date],"YYYY-MM"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Year and Month Name",FORMAT([Date],"YYYY-MMM"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Fiscal Year", IF( FiscalMonthEnd = 12, YEAR([Date]), IF( MONTH([DATE]) &amp;lt;= FiscalMonthEnd, YEAR([DATE])-1, YEAR([Date]))),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Fiscal Month", IF( FiscalMonthEnd = 12, MONTH([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF( MONTH([Date]) &amp;lt;= FiscalMonthEnd, FiscalMonthEnd + MONTH([Date]), MONTH([Date]) - FiscalMonthEnd))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add the Quarter and other quarter related data for each date&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Quarters = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Months,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Quarter",ROUNDUP(MONTH([Date])/3,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Year and Quarter",[Year] &amp;amp; "-Q" &amp;amp; ROUNDUP(MONTH([Date])/3,0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add the Day and other day related data for each date&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Days = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarters,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Day",DAY([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;"Day Name",FORMAT([Date],"DDDD"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Day Of Week",WEEKDAY([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Day Of Year", DATEDIFF (DATE(YEAR([Date]),1,1), [Date], DAY) + 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add the Week (assuming each week starts on a Sunday) and other week related data for each date&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Weeks = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Days,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Week Of Month (Sunday)",INT((DAY([Date])-1)/7)+1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Week of Year (Sunday)",WEEKNUM([Date],1),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Year and Week (Sunday)",[Year] &amp;amp; "-W" &amp;amp; WEEKNUM([Date],1))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Add an 'Is Working Day' column which will be true for all days but Saturday and Sunday.&lt;/P&gt;&lt;P&gt;var WorkingDays = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Weeks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Is Working Day", NOT WEEKDAY( [Date] ) IN {1,7})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN WorkingDays&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make your supplier table, just have additional table with only supplier names and an index column. e.g. 1-15.&lt;/P&gt;&lt;P&gt;You can join this table to yuor fact table on Supplier Name(this will work) but better yet you merge your new spllier table with index column and bring just index column into fact table. You can now delete supplier from your fact table and join the supplier table based on the index.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For all visuals use fields from date and new supplier table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have sample file and this is too much, just send it across and I'll do it for you. Thanks..&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 18:03:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2534137#M71151</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-23T18:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2538916#M71463</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="192401" data-lia-user-login="v-easonf-msft" class="lia-mention lia-mention-user"&gt;v-easonf-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I would like to thank you very much for your kind reply ☺.&amp;nbsp; &amp;nbsp;I added the columns and formulas you stated and I now see the &lt;STRONG&gt;% Early/Ontime&lt;/STRONG&gt; for each &lt;STRONG&gt;Supplier&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;Name&lt;/STRONG&gt; based on all my data rows that go back to &lt;STRONG&gt;Due Date&lt;/STRONG&gt;&amp;nbsp; Jan 1 2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I need the ability to define the time period and see the coresponding "&lt;STRONG&gt;% On Time/Early&lt;/STRONG&gt;".&amp;nbsp; For example just calculate &lt;STRONG&gt;% On Time/Early&lt;/STRONG&gt; based on &lt;STRONG&gt;Due Dates&lt;/STRONG&gt; in 2021 or YTD 2022 or 1st Quarter 2022 or perhaps just January 2022.&amp;nbsp; &amp;nbsp;I thought I could accomplish this by simply adding in a slicer for "DUE DATE"&amp;nbsp; &amp;nbsp;but it does not appear to work.&amp;nbsp; &amp;nbsp;See screen capture below&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;Could you please advise if the selective &lt;STRONG&gt;Due Date&lt;/STRONG&gt; range is possibleis and what I need to do to accomplish this?&amp;nbsp; Thanks again!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 12:41:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2538916#M71463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-25T12:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2538975#M71469</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="179903" data-lia-user-login="Whitewater100" class="lia-mention lia-mention-user"&gt;Whitewater100&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your kind reply!&amp;nbsp; I tried to enter your first formula but it produced an error and I could not get any furhter,&amp;nbsp; See below&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;I dont see a way to send you my file as an attachment?&amp;nbsp; Do your need my Power BI File and a sample of the source Data file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 13:01:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2538975#M71469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-25T13:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate % On Time Delivery for our suppliers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2539033#M71472</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;It looks like your question is solved, but if not,you can use GoogleDrive,WETRANSFER,DROPBOX by clicking on object above,to right of smiley face. Using a PBI file is generally the easiest to look at and reivew. I'm tied up most of today but can check your file out later if you want. Thanks..&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 13:17:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-On-Time-Delivery-for-our-suppliers/m-p/2539033#M71472</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-25T13:17:07Z</dc:date>
    </item>
  </channel>
</rss>

