Forum Discussion

SUMESHKUMAR22's avatar
SUMESHKUMAR22
Icon for Helper IV rankHelper IV
4 years ago
Solved

Create calculated column based on single value in another column

Hi Anonymous  & all, Problem: I want to create a column CLICKED(Y/N) on  the basis of clicks column where if the value of clicks =1 for any id then the value then the value for clicked column will...
  • Greg_Deckler's avatar
    4 years ago

    SUMESHKUMAR22 Try:

    Clicked (Y/N) = 
      VAR __ID = [ID]
      VAR __Max = MAXX(FILTER(ALL('Table'),[ID]=__ID),[CLICKS])
    RETURN
      IF(__Max = 1,"Y","N")
  • v-zhangti's avatar
    4 years ago

    Hi, SUMESHKUMAR22 

     

    1. Calculated column

     

    Clicked (Y/N) =
    IF (
        CALCULATE (
            MAX ( 'Table'[CLICKS] ),
            FILTER ( 'Table', [ID ] = EARLIER ( 'Table'[ID ] ) )
        ) = 1,
        "Y",
        "N"
    )
    

     

     

         2. Measure

     

    Clicked (Y/N) M = 
    IF (
        CALCULATE (
            MAX ( 'Table'[CLICKS] ),
            FILTER ( ALL('Table'), [ID ]= MAX( 'Table'[ID ] ) )
        ) = 1,
        "Y",
        "N"
    )
    

     

     

    Best Regards,

    Community Support Team _Charlotte

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

  • Ashish_Mathur's avatar
    4 years ago

    Hi,

    You may download my PBI file from here.

    Hope this helps.