Forum Discussion

efowler's avatar
efowler
Helper II
5 years ago
Solved

How to Aggregate based on DateDiff Column?

Hi, I am trying to show a line chart in Power BI based on a DateDiff column.    The example in Excel is attached as well as how it currently looks in Power BI.   Any suggestions on how I can do a Sum (running total) of the value then show the line graphs as a cummulative total of the values called R1000?  

 

X Axis = Date Diff "MIS" 1 through 50

Y Axis = Cumulative total "R1000" based on the prior Date Diff value

Legend = 2018, 2019, 2020Power BI (Bad)MS Excel (Good)

7 Replies

  • richbenmintz's avatar
    richbenmintz
    Resident Rockstar

    Hi efowler ,

     

    Below you will find an example of a running total calculation, that should get you going in the right direction.

    Cummulative R1000 = 
    	Calcluate(
    		SUM('table'[R1000]), 
    			filter(
                                    allselected('table'[MIS (Failure)]), 'table'[MIS (Failure)]<=max('table'[MIS (Failure)])
                         )
    )

     

    Hope that helps,

     

    • efowler's avatar
      efowler
      Helper II

      Hi, thanks..    R1000 is a measure.  Does that make a difference?   I can not find the 'table'[R1000], I believe that is because it is a measure?

      • richbenmintz's avatar
        richbenmintz
        Resident Rockstar

        Hi efowler ,

         

        'table' is a place holder as i do not know the name of your table, for the measure name please leave out the table name