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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors