<?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: M/M/C Queue Theory Formula Implementation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104996#M109361</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;! Yes, I can't attach the pbix directly so here's a OneDrive link to my test pbix:&lt;BR /&gt;&lt;A href="https://younglivingeo-my.sharepoint.com/:u:/g/personal/ebullock_youngliving_com/ET70G0lc9WJHj_6ny0BWz5IBbmccrwT3u0Jp0R5GboIh9A?e=E1yaIz" target="_blank"&gt;MMC_Queue_Theory_Test.pbix&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 01:39:00 GMT</pubDate>
    <dc:creator>Data_Struggles_</dc:creator>
    <dc:date>2023-03-01T01:39:00Z</dc:date>
    <item>
      <title>M/M/C Queue Theory Formula Implementation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104661#M109334</link>
      <description>&lt;P&gt;I am attempting to implement an M/M/c Queuing Theory model in PowerBI using DAX(we previously used an Excel Erlang add-in but found it to be inaccurate at low volumes) and I'm running into issues. I am not a statistician by any means so I've used a GitHub doc as reference(link below; page 150 for M/M/c formulas, 145 for variable info) as I've built the formulas. Below is the DAX script for the table and the link to the reference doc:&lt;BR /&gt;Ref doc:&amp;nbsp;&lt;A href="https://yzr95924.github.io/pdf/book/Basic-Queueing-Theory.pdf" target="_blank" rel="noopener"&gt;https://yzr95924.github.io/pdf/book/Basic-Queueing-Theory.pdf&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;QTheoryTest3 = 
var Volume = 50 //in 30 min interval
var IntervalSize = 60 //in minutes
var AHT = 10 //in minutes
var AHT_Adj = AHT / IntervalSize // AHT_Adj is S
var ArrivalRate = Volume * (IntervalSize / 30) // ArrivalRate is lambda
var ServiceRate = (1 / AHT) * IntervalSize
var MinServers = 2
var MaxServers = 50

RETURN
ADDCOLUMNS(
    ADDCOLUMNS(
        ADDCOLUMNS(
            ADDCOLUMNS(
                ADDCOLUMNS(
                    SELECTCOLUMNS(GENERATESERIES(MinServers,MaxServers),"Val1",[Value]), //Val1 is c
                    "Val1-1",[Val1] -1
                ),
                "TrafIntensity", ArrivalRate * AHT_Adj //TrafIntensity is rho
            ),
            //The Summation piece of the Erlang C probability. Val2 is n
            "SubProb", SUMX(SELECTCOLUMNS(GENERATESERIES(0,[Val1-1]),"Val2",[Value]), DIVIDE(POWER([TrafIntensity],[Val2]),FACT([Val2])) + DIVIDE(POWER([TrafIntensity],[Val1]),FACT([Val1])))
        ),
        "ErlangCProb", DIVIDE(DIVIDE(POWER([TrafIntensity],[Val1]),FACT([Val1])),(1 - DIVIDE([TrafIntensity],[Val1])) * [SubProb])
    ),
    "AvgWait", DIVIDE([ErlangCProb] * AHT_Adj, [Val1] * (1 - DIVIDE([TrafIntensity],[Val1]))) * IntervalSize //converted back to minutes
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; For this test table my desired output is the Average Wait Time (as I'll implement that in a faux for/while loop process), and as I looked through the formulas in the reference doc I found that I largely needed to use the Erlang C probability formula and the expected Wait time formula (both highlighted below) to achieve that. The calculation of these two formulas is what is being performed in my DAX script.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I am receiving inaccurate results(see screenshot of table below). I have run through the setup compared with the formulas in the reference sheet and for the life of me I can't figure out what is wrong.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As I mentioned above, I'm not much of a statistician and so it is possible I missed something, so I am hoping someone may have some additional insight into where I'm going wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:45:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104661#M109334</guid>
      <dc:creator>Data_Struggles_</dc:creator>
      <dc:date>2023-02-28T20:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: M/M/C Queue Theory Formula Implementation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104854#M109351</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="516909" data-lia-user-login="Data_Struggles_" class="lia-mention lia-mention-user"&gt;Data_Struggles_&lt;/a&gt;&amp;nbsp;Any chance you can post a link to your PBIX?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 23:00:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104854#M109351</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-02-28T23:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: M/M/C Queue Theory Formula Implementation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104996#M109361</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;! Yes, I can't attach the pbix directly so here's a OneDrive link to my test pbix:&lt;BR /&gt;&lt;A href="https://younglivingeo-my.sharepoint.com/:u:/g/personal/ebullock_youngliving_com/ET70G0lc9WJHj_6ny0BWz5IBbmccrwT3u0Jp0R5GboIh9A?e=E1yaIz" target="_blank"&gt;MMC_Queue_Theory_Test.pbix&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 01:39:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3104996#M109361</guid>
      <dc:creator>Data_Struggles_</dc:creator>
      <dc:date>2023-03-01T01:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: M/M/C Queue Theory Formula Implementation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3111290#M109907</link>
      <description>&lt;P&gt;As these things tend to go, it turns out I just misunderstood the Summation piece of the Erlang C probability formula. I was able to update my DAX to the following and it worked like a charm:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;QTheoryTest3 = 
var Volume = 50 //in 30 min interval
var IntervalSize = 60 //in minutes
var AHT = 10 //in minutes
var AHT_Adj = AHT / IntervalSize // AHT_Adj is S
var ArrivalRate = Volume * (IntervalSize / 30) // ArrivalRate is lambda
var ServiceRate = (1 / AHT) * IntervalSize
var MinServers = 2
var MaxServers = 50

RETURN
ADDCOLUMNS(
    ADDCOLUMNS(
        ADDCOLUMNS(
            ADDCOLUMNS(
                ADDCOLUMNS(
                    SELECTCOLUMNS(GENERATESERIES(MinServers,MaxServers),"Val1",[Value]), //Val1 is c
                    "Val1-1",[Val1] -1
                ),
                "TrafIntensity", ArrivalRate * AHT_Adj //TrafIntensity is rho
            ),
            //The Summation piece of the Erlang C probability. Val2 is n
            "SubProb", SUMX(SELECTCOLUMNS(GENERATESERIES(0,[Val1-1]),"Val2",[Value]), DIVIDE(POWER([TrafIntensity],[Val2]),FACT([Val2])))
        ),
        "ErlangCProb", DIVIDE(DIVIDE(POWER([TrafIntensity],[Val1]),FACT([Val1])), DIVIDE(POWER([TrafIntensity],[Val1]),FACT([Val1])) + ((1 - DIVIDE([TrafIntensity],[Val1])) * [SubProb]))
    ),
    "AvgWait", DIVIDE([ErlangCProb] * AHT_Adj, [Val1] * (1 - DIVIDE([TrafIntensity],[Val1]))) * IntervalSize //converted back to minutes
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Mar 2023 01:25:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/M-M-C-Queue-Theory-Formula-Implementation/m-p/3111290#M109907</guid>
      <dc:creator>Data_Struggles_</dc:creator>
      <dc:date>2023-03-04T01:25:21Z</dc:date>
    </item>
  </channel>
</rss>

