I have a star schema model.
I have 2 tables, they look like this.
D_COURSES
Course_ID
Course_Name
Subject_Order
F_STUDENTCOURSES
COURSE_ID
POINTS_CAT_A
POINTS_CAT_B
I want to take the F_STUDENTCOURSES[COURSE_ID] value and look up the Subject_Order value in the D_COURSES table. If that value is 1, I want to sum the POINTS_CAT_A or POINTS_CAT_B value, for a divide function.
This is the DAX funciton I am using:
divide(
calculate(sum(F_STUDENTCOURSE[POINTS_CAT_A]),LOOKUPVALUE(D_COURSES[SUBJECT_ORDER],F_STUDENTCOURSE[COURSE_ID],1)),
calculate(sum(F_STUDENTCOURSE[POINTS_CAT_B]),LOOKUPVALUE(D_COURSES[SUBJECT_ORDER],F_STUDENTCOURSE[COURSE_ID],1)), "")
The error message I am getting is this:
Function LOOKUPVALUE expects a column reference as argument number 2.
What am I doing wrong?