Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
OPS-MLTSD
Post Patron
Post Patron

DAX error with EARLIER and multiple filters

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)

 

tempsnipms.png

 

If someone could please help me edit the Course Completion dax above, that would be much appreciated. 

3 REPLIES 3
amitchandak
Super User
Super User

@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])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.