cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
amehmood
Helper I
Helper I

Creating a Matrix

Hi

 

 

amehmood_0-1668841220511.png

How to make Table 2 based on data in Table 1. Table 1 contains accident data, Crash ID refers to a unique ID of a crash, Veh Type refers to the types of vehicles involved in crashes, and the Driver column contains the driver either responsible or the victim. For instance, crash Id 100210000000 occurred between two cars and one of them was responsible.

 

I tried the matrix visual option and created two columns as follows.

DrRes = if([Driver]= “Responsible” , [Veh Type], blank ())

DrVic = if([Driver]= “Victim” , [Veh Type], blank ())

 

And used DrRes as Rows and DrVic as column but no luck to create desired Table 2, please assist.

2 ACCEPTED SOLUTIONS

Thanks for your kind assistance, could I ask how to create the following table

 

amehmood_0-1668931256510.png

 

from give Table 1

View solution in original post

v-yanjiang-msft
Community Support
Community Support

Hi @amehmood ,

According to your description, here's my solution.

1.Select the Driver column, then click Pivot Column.

vkalyjmsft_0-1669098988687.png

Select "Veh Type" column in the Values Column option and select Don't Aggregate in the Advanced options.

vkalyjmsft_1-1669099129627.png

Result:

vkalyjmsft_2-1669099235378.png

2. In a matrix visual, put Responsible column in Rows, Victim column in Columns, Crash ID column in Values and select Count in the dropdown option, get the correct result:

vkalyjmsft_3-1669099305379.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

5 REPLIES 5
v-yanjiang-msft
Community Support
Community Support

Hi @amehmood ,

According to your description, here's my solution.

1.Select the Driver column, then click Pivot Column.

vkalyjmsft_0-1669098988687.png

Select "Veh Type" column in the Values Column option and select Don't Aggregate in the Advanced options.

vkalyjmsft_1-1669099129627.png

Result:

vkalyjmsft_2-1669099235378.png

2. In a matrix visual, put Responsible column in Rows, Victim column in Columns, Crash ID column in Values and select Count in the dropdown option, get the correct result:

vkalyjmsft_3-1669099305379.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

daXtreme
Solution Sage
Solution Sage

File attached

Thank you very much DaXtreme very helpful, I ran to another issue: ole db or odbc error

Everything that's needed to create the matrix I created in the file is in the file. Even the transformations needed to create the table in the model from the initial one...

Thanks for your kind assistance, could I ask how to create the following table

 

amehmood_0-1668931256510.png

 

from give Table 1

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors