Good afternoon,
- Distribution of Majors or Percentage Distribution of Majors:
To get the distribution or percentage distribution of majors, you can use the CALCULATE_PERCENT function in QuickSight. Here’s how you can do it:
a. Create a new calculated field with the following formula:
CALCULATE_PERCENT(COUNT(Name), CONTEXT_MEASURES([Major]))
This will calculate the percentage of each major out of the total number of records.
b. In the visual, you can use this calculated field as the value, and Major as the dimension. This will give you the percentage distribution of majors.
Alternatively, you can use the COUNT_DISTINCT function to get the distinct count of majors, and then calculate the percentage:
(COUNT_DISTINCT(Major) / SUM(COUNT_DISTINCT(Major))) * 100
- Percentage of Graduated vs. Non-Graduated:
To get the percentage of graduated and non-graduated students, you can use a similar approach:
a. Create a new calculated field with the following formula:
CALCULATE_PERCENT(COUNT(Name), CONTEXT_MEASURES([Graduated]))
This will calculate the percentage of graduated and non-graduated students.
b. In the visual, you can use this calculated field as the value, and Graduated as the dimension. This will give you the percentage of graduated and non-graduated students.
Alternatively, you can use the SUM function to get the total count of graduated and non-graduated students, and then calculate the percentage:
(SUM(CASE WHEN Graduated = 'True' THEN 1 ELSE 0 END) / SUM(1)) * 100 AS Graduated_Percent,
(SUM(CASE WHEN Graduated = 'False' THEN 1 ELSE 0 END) / SUM(1)) * 100 AS NonGraduated_Percent
By using these approaches, you can get the desired distribution and percentage information in your QuickSight visualizations.