Forum Discussion
Copy Values
- Anonymous1 year ago
Hi, Anonymous
According to your description, I created the following two tables:
I use the following DAX expression, which mainly uses the lookup value to obtain the code of another table, so that the number of id, code, and name can be matched:
Table 2= VAR _table = ADDCOLUMNS ( ADDCOLUMNS ( SELECTCOLUMNS ( 'Table', 'Table'[Key], 'Table'[Name], 'Table'[Code] ), "Id", LOOKUPVALUE ( 'Table 2 (2)'[Code], 'Table 2 (2)'[ID], 'Table'[Key] ) ), "Value1", [Measure1], "Value2", [Measure2], "Value3", [Measure3] ) RETURN ADDCOLUMNS ( _table, "Value1_new", VAR _id = [Id] RETURN IF ( ISBLANK ( [Value1] ), FIRSTNONBLANK ( SELECTCOLUMNS ( FILTER ( _table, [Id] = _id ), [Value1] ), [Value1] ), [Value1] ), "Value2_new", VAR _id = [Id] RETURN IF ( ISBLANK ( [Value2] ), FIRSTNONBLANK ( SELECTCOLUMNS ( FILTER ( _table, [Id] = _id ), [Value2] ), [Value2] ), [Value2] ), "Value3_new", VAR _id = [Id] RETURN IF ( ISBLANK ( [Value3] ), FIRSTNONBLANK ( SELECTCOLUMNS ( FILTER ( _table, [Id] = _id ), [Value3] ), [Value3] ), [Value3] ) )I have included the PBIX file used for this tutorial below.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Anonymous ,
The best way i think of is using fill up option in Power Query so that values which are presnet in below row will get filled up in above row and vice-versa if you are looking for to copy data below..Aprt from this is there conditions in your logic where you want to copy the data.
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
dharmendars007 Thanks I do not want to backfill data in power query but write a measure or calculated column to fill the data in the report. How can this be done?
Yes the condition can be if same ID in this case 5670 then fill up data. Something like if Values are blank and ID is same then fill the values based on the existing number like line 2 in this case.
Thanks