Forum Discussion
Anonymous
7 years agoNot applicable
Latest reading formula
Hi, Can someone help me with a calculated column and a dax formula, both would have been nice. I want only the latest reading of every ID if the the tempratur is 5 or above give me true, if not g...
Mariusz
7 years agoCommunity Champion
Hi Anonymous
Please try the below Measure.
Measure =
VAR __tbl = ADDCOLUMNS(
VALUES( 'YorTable'[Id] ),
"mDate", CALCULATE(
MAX('YorTable'[Timestamp] ),
ALLEXCEPT( 'YorTable', 'YorTable'[Id] )
)
)
RETURN
CALCULATE(
COUNTROWS( 'YorTable' ),
KEEPFILTERS(
TREATAS( __tbl, 'YorTable'[Id], 'YorTable'[Timestamp] )
)
) >= 5
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
Hi Mariusz ,
Thanx for your help but,
I am only getting false, not getting true or false? Can you please check and modify this. Something is clearly missing.
- Mariusz7 years agoCommunity Champion
Hi Anonymous
The expression I posted previously was a Measure if you need a column, please use the belowSpoilerColumn = VAR mDate = CALCULATE( MAX(YourTable[Timestamp]), ALLEXCEPT(YourTable, YourTable[Id]) ) RETURN YourTable[Timestamp] = mDate && YourTable[Temoratur] >= 5Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.