<?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: data modeling for chart history in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3723596#M145010</link>
    <description>&lt;P&gt;To achieve the behavior where the score from the previous day is displayed when there is no score available for a player on a particular day, you can adjust your DAX measure accordingly. You'll need to find the last available score for each player and propagate it forward.&lt;/P&gt;&lt;P&gt;Here's how you can modify your Score_hist measure to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Score_hist =&lt;BR /&gt;VAR CurrentDate = SELECTEDVALUE('public random_players'[Data_random])&lt;BR /&gt;VAR CurrentUserHash = SELECTEDVALUE('public random_players'[user_nickname])&lt;/P&gt;&lt;P&gt;-- Find the last available score for the current user hash before or on the current date&lt;BR /&gt;VAR LastScore =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('public random_players'[Score_date_player]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('public random_players'),&lt;BR /&gt;'public random_players'[Data_random] &amp;lt;= CurrentDate &amp;amp;&amp;amp;&lt;BR /&gt;'public random_players'[user_nickname] = CurrentUserHash &amp;amp;&amp;amp;&lt;BR /&gt;'public random_players'[Score_date_player] &amp;lt;&amp;gt; BLANK()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- If no last score is found, return BLANK; otherwise, return the last score&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(LastScore),&lt;BR /&gt;BLANK(),&lt;BR /&gt;LastScore&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;In this measure:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We find the last available score for the current user hash before or on the current date using the LastScore variable.&lt;/LI&gt;&lt;LI&gt;Then, we use an IF statement to check if a last score is found. If a last score is found, we return it; otherwise, we return BLANK.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This measure should provide the behavior you described, where if a player received a score on a previous day, that score will be assigned to the player for subsequent days until a new score is recorded.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 26 Feb 2024 10:24:59 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-02-26T10:24:59Z</dc:date>
    <item>
      <title>data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3708579#M144276</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;I would like to edit and later export the data in csv, which will allow to do an effect like in this video: &lt;A href="https://www.youtube.com/watch?v=4-2nqd6-ZXg" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=4-2nqd6-ZXg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I created a new table with a list of unique dates from to.&amp;nbsp;In practice, I would like each [userhash] to have a [score] value on each day even if it was not present on that day(you can assign the last value). [Score] is the average of all previous days.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Small sample:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;User_hash&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Score&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-01&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-01&lt;/TD&gt;&lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-02&lt;/TD&gt;&l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P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;User_hash&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Score_hist&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-01&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-01&lt;/TD&gt;&lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-02&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-02&lt;/TD&gt;&lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-03&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-03&lt;/TD&gt;&lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;6.33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-04&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023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lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;6.66&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-10&lt;/TD&gt;&lt;TD&gt;asdasdqwecx&lt;/TD&gt;&lt;TD&gt;6.66&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-10&lt;/TD&gt;&lt;TD&gt;uyuytrtryfgh&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023-01-10&lt;/TD&gt;&lt;TD&gt;juurtgfdvw&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 19 Feb 2024 16:28:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3708579#M144276</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2024-02-19T16:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3709865#M144345</link>
      <description>&lt;P&gt;To achieve the desired outcome in Power BI using DAX, you can follow these steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Import your data into Power BI as a table.&lt;/LI&gt;&lt;LI&gt;Create a new table to generate a list of unique dates.&lt;/LI&gt;&lt;LI&gt;Create relationships between your original table and the date table based on the date field.&lt;/LI&gt;&lt;LI&gt;Use DAX measures to calculate the average score for each user_hash up to the current date.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's how you can write the DAX measures:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Calculate the cumulative sum of scores for each user_hash:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CumulativeScore =&lt;BR /&gt;VAR CurrentDate = MAX('Date'[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;AVERAGE('YourTable'[Score]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'),&lt;BR /&gt;'Date'[Date] &amp;lt;= CurrentDate&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Use the CumulativeScore measure to populate the Score_hist column in your final table visualization:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Score_hist =&lt;BR /&gt;VAR CurrentUserHash = 'YourTable'[User_hash]&lt;BR /&gt;VAR CurrentDate = MAX('Date'[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[CumulativeScore],&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('YourTable'),&lt;BR /&gt;'YourTable'[User_hash] = CurrentUserHash &amp;amp;&amp;amp;&lt;BR /&gt;'YourTable'[Date] &amp;lt;= CurrentDate&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have created these measures, you can create a new table visualization in Power BI. Place the Date column from your date table and the User_hash column from your original table into the Rows field, and then add the Score_hist measure to the Values field.&lt;/P&gt;&lt;P&gt;This should give you a table with the desired output, where each user_hash has a score value for each day, even if they were not present on that day. The score is the average of all previous days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 05:48:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3709865#M144345</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-20T05:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3711496#M144406</link>
      <description>&lt;P&gt;Thank you very much for your help.&amp;nbsp;I did everything as instructed but I have a problem with the Score_hist measure.&amp;nbsp;I can't denominate CurrentUserHash and refer to my main table in it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:16:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3711496#M144406</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2024-02-20T15:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3713055#M144486</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I see. It seems like you want to calculate the historical average score for each user_hash up to the current date. Let me adjust the measure to include the reference to the current user_hash in the main table. Here's how you can modify the measure:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Score_hist =&lt;BR /&gt;VAR CurrentDate = MAX('DateTable'[Date])&lt;BR /&gt;VAR CurrentUserHash = SELECTEDVALUE('OriginalData'[User_hash])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;AVERAGE('OriginalData'[Score]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('OriginalData'),&lt;BR /&gt;'OriginalData'[Date] &amp;lt;= CurrentDate &amp;amp;&amp;amp;&lt;BR /&gt;'OriginalData'[User_hash] = CurrentUserHash&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure calculates the historical average score for the currently selected user_hash up to the current date. It filters the OriginalData table to include only rows where the Date is less than or equal to the current date and where the User_hash matches the selected user_hash.&lt;/P&gt;&lt;P&gt;Make sure to replace 'OriginalData' with the name of your main table if it's different.&lt;/P&gt;&lt;P&gt;You can then use this measure in your Power BI visualizations alongside the Date and User_hash fields to display the historical average score for each user_hash on each date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 05:04:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3713055#M144486</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-21T05:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3714394#M144557</link>
      <description>&lt;P&gt;Thank you for your reply. Now the measure works almost correctly. The problem is that there are days when there is no player data. If I create an animated chart then the given player will disappear from the chart on days when he is not there.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 13:50:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3714394#M144557</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2024-02-21T13:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3716724#M144674</link>
      <description>&lt;P&gt;To ensure that the players remain visible on days when there is no data for them, you need to make sure that your data model includes all the players for all dates, even if they don't have any associated data for certain days. This means you need to ensure that your calendar table includes all dates and is properly related to your main data table.&lt;/P&gt;&lt;P&gt;Here are the steps you can take to ensure the players remain visible on the chart:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Calendar Table&lt;/STRONG&gt;: Make sure your calendar table includes all the dates you want to visualize on your chart. This table should cover a range of dates that includes the earliest date in your data and the latest date you want to display.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Relationships&lt;/STRONG&gt;: Ensure there is a relationship between your calendar table and your main data table. This relationship should be based on the date column present in both tables.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Update DAX Calculation&lt;/STRONG&gt;: Adjust your DAX calculation to consider all dates and all players, even if there is no data available for certain combinations of dates and players.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here's an updated version of the DAX calculation for Score_hist that considers all dates and all players:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Score_hist =&lt;BR /&gt;VAR CurrentDate = 'Calendar'[Date]&lt;BR /&gt;VAR CurrentUserHash = 'YourTable'[User_hash]&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF (&lt;BR /&gt;ISBLANK ( CurrentUserHash ),&lt;BR /&gt;BLANK (),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;AVERAGE ( 'YourTable'[Score] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Date] &amp;lt;= CurrentDate &amp;amp;&amp;amp;&lt;BR /&gt;'YourTable'[User_hash] = CurrentUserHash&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This modification ensures that even if there's no data available for a particular player on a certain date, the player will still be included in the visualization with a blank score value. This way, the player will remain visible on the chart throughout the date range you're visualizing.&lt;/P&gt;&lt;P&gt;Make sure to adjust the DAX expression according to your actual table and column names in Power BI. With these adjustments, your animated chart should display all players consistently across all dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question, please mark my post as solution, Appreciate your Kudos.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 09:48:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3716724#M144674</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-22T09:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3717209#M144707</link>
      <description>&lt;P&gt;Thank you for your reply. Everything is correct except that instead of BLANK score it should display the score from the previous day when the player last received a score. If someone received a score on day 1 and, for example, 9 then on days 2-8 he should be assigned a score from day 1.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 13:31:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3717209#M144707</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2024-02-22T13:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3717620#M144734</link>
      <description>&lt;P class="lia-align-left"&gt;I've managed to do it this way so far(I assigned all players to each date(I omitted all conditions to make it simpler for me):&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;New_Table =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;AllCombinations&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CROSSJOIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[Data_random]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[user_nickname]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;ActualData&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[Data_random]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AllCombinations&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Date"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Data_random]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[user_nickname]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AllCombinations&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Name"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[user_nickname]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Date"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[Data_random]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Name"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'public random_players'&lt;/SPAN&gt;&lt;SPAN&gt;[user_nickname]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AllCombinations&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Date"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Data_random]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Name"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[user_nickname]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;In the new [Value] column, I calculated the score for each player with the date condition. [score_date_player]&amp;nbsp;is the average in the public random_players table, which calculates the average of the previous days only.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Value =&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(&lt;BR /&gt;LOOKUPVALUE(&lt;BR /&gt;'public random_players'[Score_date_player],&lt;BR /&gt;'public random_players'[user_nickname],&lt;BR /&gt;NowaTabela[Name]&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('public random_players'[Score_date_player]),&lt;BR /&gt;FILTER(&lt;BR /&gt;'public random_players',&lt;BR /&gt;'public random_players'[user_nickname] = NowaTabela[Name] &amp;amp;&amp;amp;&lt;BR /&gt;'public random_players'[data_random] &amp;lt; EARLIER('NowaTabela'[Date])&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;LOOKUPVALUE(&lt;BR /&gt;'public random_players'[Score_date_player],&lt;BR /&gt;'public random_players'[user_nickname],&lt;BR /&gt;NowaTabela[Name]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class="lia-align-left"&gt;The problem is that Value returns correct values and a BLANK values if there is no data for specific date. How do I edit my function to return the last seen score_date_player instead of blank?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 15:55:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3717620#M144734</guid>
      <dc:creator>Pan_Forex</dc:creator>
      <dc:date>2024-02-22T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: data modeling for chart history</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3723596#M145010</link>
      <description>&lt;P&gt;To achieve the behavior where the score from the previous day is displayed when there is no score available for a player on a particular day, you can adjust your DAX measure accordingly. You'll need to find the last available score for each player and propagate it forward.&lt;/P&gt;&lt;P&gt;Here's how you can modify your Score_hist measure to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Score_hist =&lt;BR /&gt;VAR CurrentDate = SELECTEDVALUE('public random_players'[Data_random])&lt;BR /&gt;VAR CurrentUserHash = SELECTEDVALUE('public random_players'[user_nickname])&lt;/P&gt;&lt;P&gt;-- Find the last available score for the current user hash before or on the current date&lt;BR /&gt;VAR LastScore =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('public random_players'[Score_date_player]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('public random_players'),&lt;BR /&gt;'public random_players'[Data_random] &amp;lt;= CurrentDate &amp;amp;&amp;amp;&lt;BR /&gt;'public random_players'[user_nickname] = CurrentUserHash &amp;amp;&amp;amp;&lt;BR /&gt;'public random_players'[Score_date_player] &amp;lt;&amp;gt; BLANK()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-- If no last score is found, return BLANK; otherwise, return the last score&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ISBLANK(LastScore),&lt;BR /&gt;BLANK(),&lt;BR /&gt;LastScore&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;In this measure:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We find the last available score for the current user hash before or on the current date using the LastScore variable.&lt;/LI&gt;&lt;LI&gt;Then, we use an IF statement to check if a last score is found. If a last score is found, we return it; otherwise, we return BLANK.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This measure should provide the behavior you described, where if a player received a score on a previous day, that score will be assigned to the player for subsequent days until a new score is recorded.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Feb 2024 10:24:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/data-modeling-for-chart-history/m-p/3723596#M145010</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-26T10:24:59Z</dc:date>
    </item>
  </channel>
</rss>

