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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Matrix visual without merging

Hello

 

I have data in the format:

 

IDCountry1Country2
1Y 
2 Y
3YY

 

IDType
1A
2B
3C

 

How can I create a pivot visual that will show:

 Country1Country1Country2Country2
 Y(blank)Y(blank)
Type    
A    
B    
C    

 

I would prefer to do so without merging the tables, just by specifying a data model relationship, is that possible?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

How about create a new pivot table by using DAX:

New Pivot Table = 
var _t1=SELECTCOLUMNS('Table',"ID",[ID],"Country Type","Country1","If Y",[Country1]) 
var _t2= SELECTCOLUMNS('Table',"ID",[ID],"Country Type","Country2","If Y",[Country2]) 
return UNION(_t1,_t2)

Eyelyn9_0-1648695488526.png

And then build relationship between it and the second table:

Eyelyn9_1-1648695522103.png

Then create a Matric visual:

Eyelyn9_2-1648695543640.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

 

How about create a new pivot table by using DAX:

New Pivot Table = 
var _t1=SELECTCOLUMNS('Table',"ID",[ID],"Country Type","Country1","If Y",[Country1]) 
var _t2= SELECTCOLUMNS('Table',"ID",[ID],"Country Type","Country2","If Y",[Country2]) 
return UNION(_t1,_t2)

Eyelyn9_0-1648695488526.png

And then build relationship between it and the second table:

Eyelyn9_1-1648695522103.png

Then create a Matric visual:

Eyelyn9_2-1648695543640.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@amitchandak  thanks but as I underline in bold letters, I have two separate tables and I do not want to merge them nor combine them in one table permanently but instead use data modelling to specify a relationship. Is there a solution for this?

Thanks!

amitchandak
Super User
Super User

@Anonymous , I think This problem has been asked and I shared file. Sharing it again

 

Check operation in power query and mtrix on Page 2

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.