powerbicumulative-sumcumulative-frequency

PowerBI - Running Total on Time-Independent Data Column


I was attempting to employ the formulas here to calculate a running total of a column in PowerBI. However, my data is time-independent. In addition, every other running total calculation I've seen for PowerBI has been in reference to a date field. The target column is a "Frequency" column, and represents the estimated frequency of the event represented by each record. How do I generate a cumulative total of these frequencies, from lowest frequency to greatest? This is used to generate an exceedence curve for the consequences of events based on the running frequency total, called an F-N curve.


Solution

  • Per this site: https://www.daxpatterns.com/cumulative-total/, I was able to generate the following measure:

    Measure_cumF = 
                CALCULATE (      
                   sum([content.F]),      
                   FILTER (      
                      ALLSELECTED( Sheet1),      
                      Sheet1[Content.N] >= MIN ( Sheet1[Content.N] )  
                   )    
                )
    

    "MIN" allows the cumulative sum of "Content.F" to start at the row containing the highest value of the desired sorting list, in this case "Content.N". "MAX" will start the cumulative sum at the row containing the lowest value of "Content.N".

    "ALLSELECTED" applies the current filters to the measure. Replace with "ALL" to have a static value that always returns the cumulative sum of the entire column.