0
votes

I have a table with thousands of rows that has 3 columns (ID, Category at Intake, Category at Discharge). The categories are No Risk, Low Risk, Medium Risk, and High Risk. I'd like to create a viz that compares the count of each category between the two columns Intake and Discharge. So imagine a table with the following rows and 3 columns like this:

Category, Count Intake, Count Discharge

No Risk, 10, 20

Low Risk, 30, 30

Medium Risk, 20, 10

High risk, 5, 5

Total, 65, 65

I can create separate visuals for both columns. I've tried creating a new table with ADDCOLUMNS and SUMMARIZE -- these give me the same result for both columns.

Table 2 = SUMMARIZE(Table1,Table1[Intake Classification],"Count Intake Classification",Counta(Table1[Intake Classification]))

I tried with SUMMARIZE and can create one column. I'm stuck on the 2nd column.

1

1 Answers

0
votes

First you add a new table (Modeling tab, New Table):

RiskCat = DISTINCT(Risks[Intake])

Next add two columns (Modeling tab, New Column):

Count Intake = COUNTROWS(FILTER(Risks;RiskCat[Category] = Risks[Intake]))
Count Discharge = COUNTROWS(FILTER(Risks;RiskCat[Category] = Risks[Discharge]))

End result:

enter image description here