Forum Discussion

DK_16's avatar
DK_16
Frequent Visitor
6 years ago
Solved

Help with Running Totals...with some twists

First post here so go easy on me 🙂  I know there are a number of running total questions, but I've been unable to figure out my issue after reading through some of those.     I have a data set fro...
  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi DK_16 ,

     

    We can create four measures to meet your requirement after create two what-if parameter:

     

    M Cool Temp High Faults = IF(SUM('Table'[Colling Temperature]) < [Yerrow Value], 0,IF(SUM('Table'[Colling Temperature]) <[Red Value],1,3))

     

    M Cool Temp High SO = SUMX(TOPN(3,FILTER(ALLSELECTED('Table'),'Table'[Substation SN] <= MIN('Table'[Substation SN])),[Substation SN],DESC),[M Cool Temp High Faults])

     

    RedNotify Count = COUNTROWS(FILTER(SUMMARIZE('Table','Table'[Substation SN],"M",[M Cool Temp High SO]),[M] >= 6))

     

    YellowNotify Count = COUNTROWS(FILTER(SUMMARIZE('Table','Table'[Substation SN],"M",[M Cool Temp High SO]),[M] >= 2 && [M] <6))

     

     
    If it doesn't meet your requirement, Please show the exact expected result based on the Tables that you have shared.
     

    Best regards,
     
  • DK_16's avatar
    DK_16
    6 years ago

    v-lid-msft , I believe I figured out where our difference comes from.  I have a substation sn column that represents each system (Sub_317, Sub 329, etc).  Each system has it's own index column based on the event timestamp for each data point (the 6772-6788 values).  It looks like you may have been using the index as the substation sn value.  I created a unique id column from merging the substation sn and index columns.  I used that value in the SO measure and everything seems to work as I would like.  Thank you again for your help!

     

    M Cool Temp High SO = 
    SUMX( 
        TOPN( 3, 
            FILTER( ALLSELECTED(SampleData),
                SampleData[SN_Index] <= MIN(SampleData[SN_Index])),
            [SN_Index],DESC),
        [M Cool Temp High Faults])