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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jags8386
New Member

Create Cross table for multiple id and multiple category

I have following table structure. 

 

PersonCrime TypeWEEKID
P1ASSAULTWEEK-1
P1BURGERLYWEEK-3
P1ROBBERYWEEK-5
P1VANDALISMWEEK-3
P2BURGERLYWEEK-1
P2ROBBERYWEEK-2
P3THEFTWEEK-3
P3VANDALISMWEEK-3
P4ASSAULTWEEK-1
P4VANDALISMWEEK-1
   
   

I want to create cross tab where following structure ocmes. I want to identify how many person has done assult are involved in other crime and vice versa

 

 ASSAULTBURGERLYROBBERYTHEFTVANDALISM
ASSAULT211 2
BURGERLY121 1
ROBBERY112 1
THEFT   11
VANDALISM2  13
5 REPLIES 5
jags8386
New Member

I tried and I can only put crime type in either row or column

 

Hmm... Try making a calculated column that just equals the crime type column and put that in row and the original in column.

Can you explain more to this?

I have tried 

 

It just gives me 

 

 ASSAULTBURGERLYROBBERYTHEFTVANDALISM
ASSAULT2    
BURGERLY 2   
ROBBERY  2  
THEFT   1 
VANDALISM    3
Syk
Super User
Super User

You can use a matrix visual for this. Put the crime type on rows and columns and a count of the ID for values.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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