Forum Discussion

Augusto_H's avatar
Augusto_H
Frequent Visitor
3 years ago
Solved

Check if value exists using measure

Hi all,

I have a situation here, need to identify the measure values in the column as the example below.

 

My measure = SWITCH(TRUE(),[identified_value]=1,SELECTEDVALUE(table[Column]))

 



The espected value need to be a measure, does anyone know how to do it?

  • Hi Augusto_H ,

     

    Do you wnat to fill according to the value of [My measure] ? If it is like this, please try following steps:

     

     

    1. Add an index column like this in Power Query or your data source.

     

    2. Create following measures:

    Identify_value = AVERAGE([Avg limit]) - AVERAGE([Avg])
    
    
    My measure =
    SWITCH ( TRUE (), [Identify_value] < 0, SELECTEDVALUE ( 'Table'[Group] ) )
    
    
    Expected result = 
    VAR current_index =
        SELECTEDVALUE ( 'Table'[Index] )
    VAR current_group =
        SELECTEDVALUE ( 'Table'[Group] )
    VAR previous_index =
        MAXX (
            FILTER (
                ALL ( 'Table' ),
                'Table'[Index] < current_index
                    && 'Table'[My measure] <> BLANK ()
                    && 'Table'[Group] = current_group
            ),
            [Index]
        )
    VAR previous_value =
        MAXX (
            FILTER ( ALL ( 'Table' ), 'Table'[Index] = previous_index ),
            [My measure]
        )
    RETURN
        IF ( [My measure] = BLANK (), previous_value, [My measure] )

     

    I think this is the result you want:

    Best regards,

    Yadong Fang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Augusto_H's avatar
    Augusto_H
    Frequent Visitor

    I´m Trying using CONTAINSROW like this,

     

    UsingContains = CONTAINSROW({"Pulverizador-198"},VALUES(Table[Column]))

     

     

    Using my measure as reference the problem is Blank() values 😓

    UsingContains= CONTAINSROW({My Measure},VALUES(Table[Column]))


     

    Any suggestion ? 

    • v-yadongf-msft's avatar
      v-yadongf-msft
      Icon for Community Support rankCommunity Support

      Hi Augusto_H ,

       

      In order to better understanding your demands and give the right solution, can you tell me what's the calculation logic of [identified_value] ? Is it a measure or a column ?

       

      It would be great if you could share with me some screenshots of your data after hiding sensitive information.

       

      Thanks for your efforts & time in advance.

       

      Best regards,

      Yadong Fang

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

      • Augusto_H's avatar
        Augusto_H
        Frequent Visitor

        Hi v-yadongf-msft tks for reply.

         It's a measure to identify values out of average.

         

        Basically I need to identify vehicles outside the average and the group they belong, unfortunately I can't work with calculated fields in this case, only measure.