Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GMO_
Frequent Visitor

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. 

 

GMO__2-1596185963300.png

 

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!

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@GMO_ , 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])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@GMO_ , 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])

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.