<?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: Help with Evolution Graph in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1340884#M23945</link>
    <description>&lt;P&gt;Thanks alot for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Sep 2020 10:19:57 GMT</pubDate>
    <dc:creator>gpalfi</dc:creator>
    <dc:date>2020-09-02T10:19:57Z</dc:date>
    <item>
      <title>Help with Evolution Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1331513#M23578</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still learning Power Bi/DAX, so I first tried to search for a solution to the problem I'm facing, however I cannot seem to find the right approach. Hence I seek your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to achieve is that I can see by day on a column chart how the tickets evolve through the different states.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My model has the following tables that I can see that are needed for this.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Date/time table&lt;/LI&gt;&lt;LI&gt;Table with tickets wich have all the details (one row per ticket) -2000 rows&lt;/LI&gt;&lt;LI&gt;Changelog (many-each row is a change) -30000 rows&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The relationships are as following:&lt;/P&gt;&lt;P&gt;Date &amp;lt;one-both-many&amp;gt; created - Ticket table - Id &amp;lt;one-both-many&amp;gt;Id changelog&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following sample data is in them:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ticket table&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;_Id&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Created&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Updated&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Closed&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Status&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CS-101&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;01-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;08-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;In progress&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CS-102&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;04-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;20-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Done&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CS-103&lt;/P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t;P&gt;CS-104&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Status&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;21-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Not started&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;In progress&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;CS-104&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Status&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;27-08-20&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;In progress&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Not started&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ticket opens directly in "not started", as there was no change this is not shown in the changelog.&lt;/P&gt;&lt;P&gt;The states can go in order, or the can go back to the prevous state.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to achieve is the following:&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;</description>
      <pubDate>Fri, 28 Aug 2020 09:31:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1331513#M23578</guid>
      <dc:creator>gpalfi</dc:creator>
      <dc:date>2020-08-28T09:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Evolution Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1331666#M23585</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// This task will be much easier if
// you store all your states in
// the Changelog table. That means you
// also have to include a record for any
// ticket that just opened in the "Not Started"
// state (transition from "Not Started" to
// "Not Started." If you don't do this, the DAX will be
// much harder to write, thus slower. The Date table
// that you'll use to visualize the movement of
// tickets through time should NOT be connected 
// to any of the tables (must be DISCONNECTED).
// You can have another Date table that will join
// to Tickets[Created]/[Updated] to let you filter by
// tickets created/updated within a given period of time
// but this dimension will NOT be suitable for
// visualizing movement through time. You can
// name this Date table something like
// 'Ticket Creation/Update Dates'. The other Dates
// table will be called, say, 'Evolution Dates'.
//
// So, if the above is in place, you can
// write a measure that will show you the
// number of tickets on each day (in a given
// status). The day on which we'll calculate
// the number will be the last day of the selected
// period of time from 'Evoution Dates' (as this
// setup makes sense in this case). If you slice
// by status (and 'Evolution Status' must be
// a separate dimension NOT connected to any tables),
// you'll get the number of tickets in this status
// on the last day of the selected period.
// So, Changelog must be a hidden fact table.
// Only Tickets will join to it on Tickets[TicketID].
// No other tables can join to it. If you want
// to be able to slice by status in the Tickets
// table, then use a different dimension, for instance,
// 'Current Ticket Status' and connect it to Tickets.

// By the way, if it can happen that a ticket
// goes through different stages on the same
// day, then you have to be able to say which
// status is the last one on that day. Hence,
// you'll need another column that will tell
// you the temporal seqence of the statuses. For
// the sake of argument let's assume that this
// can't happen and for any one ticket in Changelog
// there can't be 2 rows with the same date.

[# Tickets] =
// To get the number of tickets on the last
// day of the selected period in 'Evolution Dates'
// we have to, for each ticket, find the latest
// record before or on this day and check
// if its status is in the statuses selected
// in 'Evolution Status'. If it's true, then
// count the ticket in, else don't.
var __lastDay =
    MAX( 'Evolution Dates'[Date] )
var __selectedStatuses =
    VALUES( 'Evolution Status'[Status] )
var __result =
    SUMX(
        Tickets,
        // Check if the latest record in Changelog
        // (such that its date &amp;lt;= last date of the
        // evolution period) has a status that is
        // present in the 'Evolution Status' table.
        // If so, count it in.
        var __latestStatus =
            SELECTCOLUMNS(
                // If the assumptions above are
                // satisfied, this will return
                // just one row and __latestStatus
                // will be turned automatically
                // into a scalar. If it happens
                // that this returns more than 1 row,
                // then you've got violations
                // of the assumptions and have to
                // code accordingly to accommodate
                // the changed conditions of the
                // problem.
                TOPN(1,
                    CALCULATETABLE(
                        Changelog,
                        Changelog[Change Date] &amp;lt;= __lastDay
                    ),
                    Changelog[Change Date],
                    DESC
                ),
                "@Status", Changelog[ToStatus]
            )
        return
            1 * ( __latestStatus in __selectedStatuses )
    )
return
    if( __result, __result )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Aug 2020 10:35:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1331666#M23585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-28T10:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Evolution Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1340884#M23945</link>
      <description>&lt;P&gt;Thanks alot for the help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:19:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-Evolution-Graph/m-p/1340884#M23945</guid>
      <dc:creator>gpalfi</dc:creator>
      <dc:date>2020-09-02T10:19:57Z</dc:date>
    </item>
  </channel>
</rss>

