Forum Discussion
Ranks with filter function date
- 5 years ago
The problem was that your Val_Turb_Freq_1h measure was not returning values for the day level rows. Here is a new measure that seems to work. It's a little off as your hardcoded values use a value of 81 as the threshold but the overall result for Val_Turb_Freq_1h is 80. The result from this measure matches those when 80 is used.
NewMeasure =
VAR ValTurbFreq1h =
CALCULATE (
[Val_Turb_Freq_1h],
ALLSELECTED ()
)
VAR vStop =
COUNTROWS (
FILTER (
VALUES ( fact_points_mesures_faucon[dt (10 min)] ),
[Turbidité] >= ValTurbFreq1h
)
) / 6
RETURN
vStopAlso, the logic to get your threshold values seems to be the 144th value of Turbidity (regardless if the scope is day, month, year or all time). Is that your intended logic?
Pat
The use of a date table like in that link can be used in your model, but it is not critical on this one (but keep these points in mind for future model). For the ID column, since you have a distinct value on each row, you can just use Countrows instead in many cases. If you switched to an approach to take the last value of the day, you wouldn't need the index column. Not critical, but you could significantly decrease the size of your model.
Pat
I understand. Thank you for these tips again!
I look forward to hearing from you and thank you again for your help!
See you soon!
Joël