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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AngieM
New Member

DAX Formula Help

I have two tables in my Power BI, both include a student ID code, a course code, and course credit hours. I want to find the matches between the two tables, where the 1st table (enrollment) looks for matches or no matches on the 2nd table (schedule).  The idea is to look at both the course # and the credit hours to see if there is a matching row of data on the 2nd table. and then on the first table list match or no match for both.   I have been using this formula, and it almost always works but for one student I am getting a match where I shouldn't be.  Note:  it is possible for a student to take the same course # at more than once, but it should only match once. Any help would be appreciated. 

 

The 3rd link should say no match (8239 at 4 hrs)

AngieM_0-1722455936176.jpeg

Match Status =
VAR _Course1 = 'Enrollment Report'[Course #]
VAR _Hours1 = 'Enrollment Report'[Hours]

VAR _Match =
CALCULATE(
IF(
COUNTROWS(
FILTER(
'Clinical Schedules',
'Clinical Schedules'[Course #] = _Course1 &&
'Clinical Schedules'[Hours] = _Hours1
)
) > 0,
"MATCH",
"NO MATCH"
)
)
RETURN _Match

1 ACCEPTED SOLUTION

@AngieM 

Just concat the course and hourse and use below dax to do a lookup.

NaveenGandhi_0-1722457581491.png

Match/NoMatch = if(ISBLANK(LOOKUPVALUE(Schedules[Key],Schedules[Key],Enrollement[Key])),"No Match","Match")


If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

View solution in original post

3 REPLIES 3
NaveenGandhi
Super User
Super User

Hi @AngieM 

Please post sample data, expected output along with screenshots to understand the problem better.

Regards,

NG

added, thank you

@AngieM 

Just concat the course and hourse and use below dax to do a lookup.

NaveenGandhi_0-1722457581491.png

Match/NoMatch = if(ISBLANK(LOOKUPVALUE(Schedules[Key],Schedules[Key],Enrollement[Key])),"No Match","Match")


If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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