Forum Discussion

Noogin's avatar
Noogin
Frequent Visitor
2 years ago

Difference between two columns whose values are in the same column

Greetings,
OK, so I have spent significant time trying to figure this out and I just can't seem to get anything to work. If this has been answered I have had no luck finding an answer.
I have a table that sums enrollment by the number of days prior to the first day of classes. I have data for the current term being registered for and in this case the previous year’s enrollment by the same countdown value. This way we are comparing enrollment to the same number of days prior to the first day of classes for each year. Please see the example data below.

In Power BI I can produce this:

 

Below is an example of what I need to create. That is two additional columns for "Difference" between 2023 and 2024 and the "Percent difference" between 2023 and 2024. The programming is dynamic so the next iteration will become 2024 and 2025. In other words, the Year values are not static so I cannot use the "2023" and "2024" values in any DAX.

 

 

Thank you all for your time and help,
Gary

 

 

 

2 Replies