dobiii
dobiii

Reputation: 33

Departmental yearly change in DAX Power BI

I am trying to calculate the rate of change at the college level and at the department level. My data looks like this

structure(list(ID = c(835336, 741884, 878390, 775717, 859943, 
867226, 861503, 743403, 814844, 892280, 750841, 855932, 909046, 
768939, 799734), Gender = c("M", "M", "F", "F", "F", "M", "M", 
"M", "F", "M", "F", "M", "F", "M", "M"), Ethnicity = c("Hispanic", 
"Mexican International", "Hispanic", "Hispanic", "Hispanic", 
"Hispanic", "Asian American", "Hispanic", "Hispanic", "Hispanic", 
"Hispanic", "Hispanic", "Hispanic", "Other International", "Other International"
), Year = c(2023, 2017, 2021, 2018, 2020, 2023, 2020, 2017, 2022, 
2020, 2018, 2021, 2021, 2021, 2017), College = c("C", "A", "C", 
"A", "B", "A", "A", "C", "B", "C", "A", "A", "C", "A", "C"), 
    Department = c(8, 2, 3, 2, 4, 1, 2, 6, 4, 14, 2, 11, 8, 1, 
    10)), row.names = c(NA, -15L), class = c("tbl_df", "tbl", 
"data.frame"))

I am getting the number of students enrolled in a college or department by counting the IDs. I am trying to get 6 different measurements. 1yr department change, 3yr department change, 5 yr department change, 1yr college change, 3 yr college change and 5yr college change. I also want to be able to add slicers like gender and ethnicity and I want these slicers to be able to change the measurements based on the slicers. I found some examples but they don't work because my year column is a number column, I am not sure how to about this.

Any help is very much appreciated

Upvotes: 0

Views: 29

Answers (1)

Shubham Singh
Shubham Singh

Reputation: 1

Helllo,

You can achieve this report logic in power BI Report by following these below steps.

Firstly, you need to build calculated columns to get the data based on years and department.

And then add the slicer like gender and ethnicity and try to filter based on slicers like male and Female.

Once data start filtering based on slicers take a line chart or bar chart and add those calculated columns for change variance as per years and departments.

Upvotes: 0

Related Questions