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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Column value of Unknown, Converted to know Areas and duplicated values.

Good Afternoon All,

 

I hope this is not to difficult and I'm horrible with explaining exactly what I need help with so I hope the tables below will shed some light. I have a table given to me and a recod can come in as a 'unknown' area. For each record of a 'unknown' area, I would like to duplicate that four times and replace the unknown area with the four know areas. See examples below. 

Thanks in advance. 

 

Table Given

| Value1 | Value2  | Area      |
|--------|---------|-----------|
| 12     | James   | Unknown   |
| 14     | Eric    | Unknown   |
| 10     | Steve   | UpTown    |
| 8      | Sasha   | LeftTown  |
| 6      | Tom     | RightTown |
| 19     | Jake    | DownTown  |

Table I need to Convert To

| Value1 | Value2  | Area      |
|--------|---------|-----------|
| 12     | James   | UpTown    |
| 12     | James   | LeftTown  |
| 12     | James   | RightTown |
| 12     | James   | DownTown  |
| 14     | Eric    | UpTown    |
| 14     | Eric    | LeftTown  |
| 14     | Eric    | RightTown |
| 14     | Eric    | DownTown  |
| 10     | Steve   | UpTown    |
| 8      | Sasha   | LeftTown  |
| 6      | Tom     | RightTown |
| 19     | Jake    | DownTown  |

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can try to create a new table

Table 2 = 
VAR tb1=SELECTCOLUMNS(FILTER('Table','Table'[Area]="Unknown"),"Value1",'Table'[Value1],"Value2",'Table'[Value2])
VAR tbl2=FILTER(DISTINCT('Table'[Area]),'Table'[Area]<>"Unknown")
VAR tbl3= SELECTCOLUMNS(CROSSJOIN(tbl2,tb1),"Value1",[Value1],"Value2",[Value2],"Area",'Table'[Area])
return UNION(FILTER('Table','Table'[Area]<>"Unknown"),tbl3)

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

you can try to create a new table

Table 2 = 
VAR tb1=SELECTCOLUMNS(FILTER('Table','Table'[Area]="Unknown"),"Value1",'Table'[Value1],"Value2",'Table'[Value2])
VAR tbl2=FILTER(DISTINCT('Table'[Area]),'Table'[Area]<>"Unknown")
VAR tbl3= SELECTCOLUMNS(CROSSJOIN(tbl2,tb1),"Value1",[Value1],"Value2",[Value2],"Area",'Table'[Area])
return UNION(FILTER('Table','Table'[Area]<>"Unknown"),tbl3)

please see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks so much, your tb1 solution opened my eyes up to what I really needed.

@Anonymous 

you are welcome.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.