The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am trying to get the following calculated column to work properly witout any errors:
Course Completion = CALCULATE(COUNT(outcome[CLIENTID]),
outcome[INTERVAL]="First Entry" && outcome[OUTCOME_DATE]<>BLANK(), FILTER(AND(outcome, (clients[CLIENTID], AND('target'[CATEGORY]="Course Completions",outcome[Fiscal Year (Outcome)]=EARLIER(target[FISCAL_YEAR_CODE]) && (outcome[CLIENTID]=EARLIER(clients[CLIENTID])
)))
the Course Completion measure above should calculate the number of program completions in a particular fiscal year based on the target of completions from the target table.
I have a number of client intake measure that works completely fine:
Course Starts = CALCULATE(COUNT(clients[CLIENTID]), FILTER(clients, AND('target'[CATEGORY]="Client start",clients[Fiscal Year (Starts)]=EARLIER(target[FISCAL_YEAR_CODE]) && AND(clients[PROJECT_NUM]=EARLIER(target[PROJECT_NUM]),clients[LOCATION_ID]=EARLIER(target[LOCATION_ID])))))
The Course Completion measure is based off of the Course Start measure - i.e. - I want to know out of the clients that have started the program, how many completed it in a particular fiscal year. I have a 1 to many relationship between my clients and outcome table. There are no relationships betwee my outcome table and target table; however, there is an indirect relationship between my client table and target table through a dim table (please see attached image)
If someone could please help me edit the Course Completion dax above, that would be much appreciated.
@OPS-MLTSD , Try like
Course Completion = CALCULATE(COUNT(outcome[CLIENTID]),
outcome[INTERVAL]="First Entry" && outcome[OUTCOME_DATE]<>BLANK(), FILTER(outcome, && 'target'[CATEGORY]="Course Completions" && outcome[Fiscal Year (Outcome)]= target[FISCAL_YEAR_CODE] && outcome[CLIENTID]=clients[CLIENTID])
)
@amitchandak Thank you but unfortunately it did not work. This is the error I get - "The syntax for '&&' is incorrect. (DAX(CALCULATE(COUNT(outcome[C...."
If someone could please help me with this dax error, that would be much appreciated 🙂