Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Help required to replace blank value with a measure

Hi,

 

I am trying to replace blank values in the column "value" with the max value if country = US.

It is working fine if i enter replacement value as integer.

 

Columns in Table A: Key, Country, Value

Columns in Table B: Key, Country, Sales

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thanks in advance!

5 Replies

  • Dear friend , You can use

    Replace = IF (ISBLANK(Values) , 0 ,Values)

     

     

    This will help 

     

     

    Please give appreciation by pressing kudos button 

    And if it helped please accept this post as an answer 

     

    If you didn't get to answer 

    Please tag me I'll be more than happy to help you !

    Regards 

    Sujit

    • Sujit_Thakur's avatar
      Sujit_Thakur
      Icon for Solution Sage rankSolution Sage

      Dear Anonymous  , 

      I hope you reached your goal 

      Please accept my post as solution , if it helped , if you have doubt feel free to tag and reply 😁

       

      Regards ,

      Sujit Thakur 

  • Anonymous 

     write

    if(isblank('Table A'[ Value]) , _num,'Table A'[ Value])

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi,

      I had initially tried this out but it did not work - check the original screenshot.

      However for now i was able to solve it.

       

      Thanks 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Alright so this is how i resolved it.. Might not be the smartest way but it worked

     

    Created a variable '_num' : this contains the max value of column [Value] when country is US 

     
     
    CONSOLIDATED WAY =
    VAR _num = MAXX('Table A',CALCULATETABLE(VALUES('Table A'[Value]),'Table A'[Country]="US"))
    return
    IF(
    ISBLANK('Table A'[Value]),_num, 'Table A'[Value])