Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Get value from first timestamp as a measure while filtering

Hi,

 

I have a issue where I'm trying to get the value(decimal number) as my output in a measure, but it needs to filter to MIN timestamp of that task and another filter. How can I get this?

 

This is what I've tried
min timestamp value of minutesleft =
CALCULATE(SUM(Table[minutesleft of workday]), Table[tasknumber] = 72, Table[isMain] = TRUE(), FILTER(Table, Table[originalTimeStamp] = MIN(Ark2[originalTimeStamp])))

min timestamp value of minutesleft =
CALCULATE(SUM(Table[minutesleft of workday]), Table[tasknumber] = 72, Table[isMain] = TRUE(),
FILTER(ALLSELECTED(Table), Table[originalTimeStamp] = MIN(Table[originalTimeStamp]) && Table[tasknumber] = max(Table[tasknumber])))
 
test =
CALCULATE(SUMX(Table, Table[minutesleft of workday]), Table[tasknumber] = 72, Table[isMain] = TRUE(),
FILTER(ALLSELECTED(Table), Table[originalTimeStamp] = MIN(Table[originalTimeStamp])), allexcept(Table, Table[tasknumber] ))


I've tried all of these, but they all return BLANK, since there are timestamps before this on some ID's, with different tasknumber.
Any good ideas on how to get just this one value. I would like to not create a calculated column to get the answer for this.

I've uploaded my pbix file here

https://gofile.io/d/Yi8fne

 

Any help would be great!
Thanks!

4 Replies

  • gpiero's avatar
    gpiero
    Icon for Skilled Sharer rankSkilled Sharer

    Anonymous 

     

    Hi,
    just for my understanding, could you help me to get what is the value expected based on your data?

     

    Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can try to use the following measure if it meets your requirement:

    measure 2 =
    VAR minTS =
        CALCULATE (
            MIN ( 'Table'[originalTimeStamp] ),
            FILTER ( ALLSELECTED ( 'Table' ), [tasknumber] = 72 )
        )
    RETURN
        CALCULATE (
            SUM ( 'Table'[minutesleft of workday] ),
            FILTER ( ALLSELECTED ( 'Table' ), [originalTimeStamp] = minTS ),
            VALUES ( 'Table'[ID] ),
            VALUES ( 'Table'[tasknumber] )
        )
    

    Regards,

    Xiaoxin Sheng