Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Replicate value based on similar value in reference column

Hello, 

 

I'm having issues wrapping my head around something that I believe can be easily solved, but I can't find an answer to. 

 

I have a table with a key in the first column that is similar for a set of rows in my table. 

A reference number (013 Ref) that is available for some of the rows in my table. 

 

What I'd like to achieve is to replicate the 013 Ref in a new calculated column (013 Common Ref) for all the rows where the "004 Key" is the same. 

 

 

I've tried to use different forms of IF condition in a new calculated column but I'm totally stuck on the second argument 

(simplified DAX logic:) 

  • Column "013 Common Ref" = IF ( "013 ref" <> Blank() , "013 ref" , ?? a expression that would return the first available 013 Ref for all the rows that have a blank 013 ref)???

I thought using some kind of "First non bank value" function, but I can't seem to make it work. 

 

Can anybody help me? 

 

Thank you very much!

 

 

 

  • Anonymous , Create a new column like

    new colum = maxx( filter(Table,[004 Key] = earlier([004 Key])),[013 Ref])

    or

    new colum = if(isblank([013 Ref]), maxx( filter(Table,[004 Key] = earlier([004 Key])),[013 Ref]),[013 Ref])

2 Replies

  • Anonymous , Create a new column like

    new colum = maxx( filter(Table,[004 Key] = earlier([004 Key])),[013 Ref])

    or

    new colum = if(isblank([013 Ref]), maxx( filter(Table,[004 Key] = earlier([004 Key])),[013 Ref]),[013 Ref])

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak  Thank you very much! 
      I knew it was an easy one... still so much to learn 🙂