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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to create a matrix-like table in the data view?

Hi everyone,

 

I need your help with the following. I've been struggling for hours 😞

 

I uploaded the following table as an Excel file into BI desktop.

 

Incident TypeIncident DateHospitalMonth

Injury

01/12/2020ADec
Injury02/12/2020ADec
Injury25/10/2020AOct
Injury06/10/2020BOct
Near Miss B 
Near Miss B 
Near Miss C 
Damage C 
Damage C 
Damage D 

 

I created a matrix visualisation out of it that looks like the below

MonthHospital AHospital BHospital CTotal
Jan253648109
Feb156728
Mar405060150
Apr10203060

 

So in the rows there's the month, in the columns there're the hospitals and in the values field there's a count of Incident Type.

 

And what I am trying to do now is to create an identical table (like the matrix above) but as an actual table in the data view, so that I can subsequently calculate a monthly rate of each incident type per 1,000 personnel for each hospital. 

 

Is that possible and if what how to do it? I've read some stuff about calculated tables, but I couldn't do it myself.

I'd be very grateful for your help.

 

Thank you!

1 ACCEPTED SOLUTION

@Anonymous 

See if this works for you. First the model:
Model.JPG

 

Now the measures:

Count of Injuries = COUNT('DataTable'[Incident Type])
Population = SUM(Population[Population])
Injuries per 1000 population = 
DIVIDE([Count of Injuries], [Population]) * 1000

 

And this is the result:

result.JPG

 

I've attached the PBIX file for you





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hello everyone, 

 

I'd like to ask for one more piece of advice. 

 

I calculated the measures as suggested,

The only problem is that the population measure summed the populations of all hospitals into one i.e.

Hospital A - 1000

Hospital B - 2000

Hospital C - 3000

It summed into 6000, and now in the rate's calculation it is actually dividing by 6000 for EACH hospital rather than for the population of each hospital. I need the total number of injuries for each respective hospital to be divided by the respective population of that hospital.

 

Any ideas on how to make it work?

 

Thank you

PaulDBrown
Community Champion
Community Champion

@Anonymous 

You should be able to add the calculations using measures. Can you post sample data (as data; not as an image) of your tables and  depiction of the model view to see the relationships between tables?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hi Paul,

 

Due to the nature of my work I cannot take the exact snapshot of my data, but below is an example of what it is like. The 'excel formula' is how I used to do the rates calculation manually in excel. 

maggieldn_1-1608066462290.png

 

I hope this makes sense 

 

@Anonymous 

See if this works for you. First the model:
Model.JPG

 

Now the measures:

Count of Injuries = COUNT('DataTable'[Incident Type])
Population = SUM(Population[Population])
Injuries per 1000 population = 
DIVIDE([Count of Injuries], [Population]) * 1000

 

And this is the result:

result.JPG

 

I've attached the PBIX file for you





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

It has worked, thank you so much Paul!

Z_T_W
New Member

Hi there @Anonymous,

 

I'd be glad to help you out here. Quick question though; wouldnt you need more data to complete this calculation?

 

Maybe something like 'Total Number of Employees.' at each hospital. Do you have this data?

 

Regards,

 

Zach W.

Anonymous
Not applicable

Hola Zach,

So I have created a separate table with population/number of employees for each hospital and linked them (in the model view) on the name of the hospital. I don't know if this is the best way to do it but that was the only one I could think of!

Thanks,

Maggie

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors