Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Show last available value in matrix

Hi everyone,

 

I have created a calculated column that shows me cumulative data from inception up to selected date for a project(so it can grow or be lower based on how the (let's say order value) has changed. My data comes from ORCL database so the full timeline is not displayed as it only shows data if there was a modification in that specific date. What i want to say:

 

Date            Project     Value

FY19-P01         x             xxx

FY19-P05         x             xxx
FY19-P12         x             
(so there might be a gap of some months if there is nothing populated there)

 

What i try to do in my analysis, is compare the cumulative data from FY18-P12 and FY19-P12. But there are cases where, in my table, there is no line with that date from some projects so in my matrix it will show nothing. Is there a way to display the last available cumulative data? 

Using the example above, if there was no change from FY19-P05 up to FY19-P12, just display the data from FY19-P05.

  • Anonymous's avatar
    Anonymous
    7 years ago

    How i worked this out: In Power Query, created a table with distinct project numbers and joined it with distinct financial dates column so the result would be a combination of every single project with every single financial date. This is more of a workaround as it creates a table with a lot of rows (of course depending on the size of the initial data [for it was from 50k rows to 940k]), but this is how i solved it.

4 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    You could

    1. Find out what the previous date is

    2. Calculate the value for the current en previous date

    3. If they're the same, return that value, otherwise return value for current date

    I can't be more specific without more details, especially the code you use for the calculated column ( and  a sample of your data tables)

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

    • Anonymous's avatar
      Anonymous
      Not applicable
      AlB 
      METRIC_CUMULATIVE = Var Currentdata=TABLE[CALENDARISTIC_DATE]
      Return
      if(COUNTROWS(TABLE)>0,
      CALCULATE(SUM(TABLE[METRIC]),
      FILTER(ALLEXCEPT(TABLE,TABLE[PROJECT]),TABLE[CALENDARISTIC_DATE]<=Currentdata)), BLANK())
       
      this is how i calculate the cumulative column. Unfortunately the data is really sensitive.
  • v-diye-msft's avatar
    v-diye-msft
    Icon for Community Support rankCommunity Support

     Hi Anonymous 

     

    If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    How i worked this out: In Power Query, created a table with distinct project numbers and joined it with distinct financial dates column so the result would be a combination of every single project with every single financial date. This is more of a workaround as it creates a table with a lot of rows (of course depending on the size of the initial data [for it was from 50k rows to 940k]), but this is how i solved it.