<?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: Cases per Day Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183298#M188077</link>
    <description>&lt;P class=""&gt;Please try the logic below:&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="" tabindex="0" role="group" aria-label="dax code"&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Cases per Day =&lt;BR /&gt;VAR _TotalCases =&lt;BR /&gt;SUM ( FactCases[Cases] )&lt;BR /&gt;VAR _ShippingDays =&lt;BR /&gt;SUM ( FactCases[ShippingDays] )&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE ( _TotalCases, _ShippingDays )&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 15 May 2026 06:40:39 GMT</pubDate>
    <dc:creator>cengizhanarslan</dc:creator>
    <dc:date>2026-05-15T06:40:39Z</dc:date>
    <item>
      <title>Cases per Day Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183169#M188075</link>
      <description>&lt;P&gt;Hello.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to divide total cases by shipping days and display it on a matrix table with year and month in the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure out how to get the cases per day to show.&amp;nbsp; So, in the year total, I should get total cases for that year divided by total shipping days in that year.&amp;nbsp; Conversely, in each month, I should get total cases for that month divided by total shipping days in that month.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in January 2026, there were 70 cases and 21 shipping days.&amp;nbsp; So, cases per day should be 70/21 = 3.33.&amp;nbsp; And, for 2025, 698/253 = 2.75&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, I can't come up with a dax that does this calculation.&amp;nbsp; Help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample file here: &lt;A href="https://drive.google.com/file/d/1aLelYdd-wkfF-n4wziWDrf7lzIdbNe_Z/view?usp=sharing" target="_self"&gt;Link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 03:27:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183169#M188075</guid>
      <dc:creator>etane</dc:creator>
      <dc:date>2026-05-15T03:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cases per Day Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183298#M188077</link>
      <description>&lt;P class=""&gt;Please try the logic below:&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="" tabindex="0" role="group" aria-label="dax code"&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Cases per Day =&lt;BR /&gt;VAR _TotalCases =&lt;BR /&gt;SUM ( FactCases[Cases] )&lt;BR /&gt;VAR _ShippingDays =&lt;BR /&gt;SUM ( FactCases[ShippingDays] )&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE ( _TotalCases, _ShippingDays )&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 May 2026 06:40:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183298#M188077</guid>
      <dc:creator>cengizhanarslan</dc:creator>
      <dc:date>2026-05-15T06:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cases per Day Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183380#M188080</link>
      <description>&lt;P&gt;Add a new column onto your calendar table to flag whether a day is a holiday or not. You can change the existing ADDCOLUMNS to be&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calendar =

VAR Days = CALENDAR(DATE(year(TODAY())-7,1,1),DATE(year(today())+1,12,31))
VAR Holidays = {
        (1, 1),   
        (2, 19),  
        (5, 27),  
        (7, 4),   
        (9, 2),   
        (11, 28), 
        (11, 29), 
        (12, 24), 
        (12, 25)  
    }
Return ADDCOLUMNS(
    Days,
    "Today", TODAY(),
    "Year#", YEAR([Date]),
    "Year", FORMAT(YEAR([Date]),"#"),
    "Month#", VALUE(FORMAT(MONTH([Date]),"#")),
    "Month Number",FORMAT([Date],"MM"),
    "Month", FORMAT([Date],"mmm"),
    "Quarter#",QUARTER([Date]),
    "Quarter","Q"&amp;amp;FORMAT([Date],"Q"),
    "Year Month", FORMAT([Date],"YYYYMM"),
    "Year Quarter", FORMAT(YEAR([Date]),"#") &amp;amp;"Q"&amp;amp;FORMAT([Date],"Q"),
    "Week Number", FORMAT(WEEKNUM([Date]),"00"),
    "Week In Month",FORMAT(WEEKNUM([Date],2) - WEEKNUM(EOMONTH([Date],-1)+1,2)+1,"#"),
    "Is Holiday", ( MONTH( [Date] ), DAY( [Date] ) ) IN Holidays
    )&lt;/LI-CODE&gt;
&lt;P&gt;You can then change the [Shipping Days] measure to be&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Shipping Days = VAR MinDate = MIN( Calendar[Date] )
VAR MaxDate = MAX( Calendar[Date] )
VAR Holidays = CALCULATETABLE(
    VALUES( Calendar[Date]),
    Calendar[Is Holiday] = TRUE
)
VAR WorkingDays = NETWORKDAYS( MinDate, MaxDate, 1, Holidays)
RETURN WorkingDays&lt;/LI-CODE&gt;
&lt;P&gt;And the [Case per Ship Day] stays the same.&lt;/P&gt;
&lt;P&gt;You should also change the relationship between Calendar and the fact table to be single direction, there's no need for it to be bi-directional.&lt;/P&gt;
&lt;P&gt;See the attached PBIX for a working sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 08:21:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183380#M188080</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2026-05-15T08:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cases per Day Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183688#M188084</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; I love how easy it is to apply your solution.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 15:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183688#M188084</guid>
      <dc:creator>etane</dc:creator>
      <dc:date>2026-05-15T15:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cases per Day Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183689#M188085</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; I don't see how I can sum the number of shipping days.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 15:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cases-per-Day-Calculation/m-p/5183689#M188085</guid>
      <dc:creator>etane</dc:creator>
      <dc:date>2026-05-15T15:20:15Z</dc:date>
    </item>
  </channel>
</rss>

