Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Ranks with filter function date

Hello to all, I use the following function filter for my Ranks measurement but I can't get the result I want: Index_Arrets_Turbidity = VAR min_ = MIN ( dim_date[Date] ) VAR max_ = MAX ( dim_dat...
  • mahoneypat's avatar
    mahoneypat
    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
        vStop

     

    Also, 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