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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ShawnHarrison
Helper I
Helper I

Find records that don't have a match in another table.

Hi,

I am trying to find rows that don't have a match in another table. Basically, I have a main table in my data that contains records of a task. In another table, there is a row for each month of the year that contains a percent of how far along they have progressed. The data in that table would look something like this...

 

TaskID       Month              Percent

1                September       60

1                October            70

2                September        40

 

 

What I need is to be able to find a way to display in a table the ID's that don't have a row for a given month. For example, the user selects October in a slicer and only sees the task that doesn't have an entry for October, in this case, taskID 2.

 

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @ShawnHarrison ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1699844140572.pngvtangjiemsft_1-1699844153715.pngvtangjiemsft_2-1699844162572.png

(2) We can create a measure. 

Missing Tasks = 
VAR SelectedMonth = SELECTEDVALUE('MonthTable'[Month])
VAR TasksWithMonth = CALCULATETABLE(VALUES(ProgressTable[TaskID]), ProgressTable[Month] = SelectedMonth)
RETURN
CONCATENATEX(
    EXCEPT(VALUES(MainTable[TaskID]), TasksWithMonth),
    MainTable[TaskID],
    ", "
)

(3) Then the result is as follows.

vtangjiemsft_3-1699844291932.pngvtangjiemsft_4-1699844303252.pngBest Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Don't you have a Year column in the first table?  If you do, it will become fairly easy to solve the question.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-tangjie-msft
Community Support
Community Support

Hi @ShawnHarrison ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1699844140572.pngvtangjiemsft_1-1699844153715.pngvtangjiemsft_2-1699844162572.png

(2) We can create a measure. 

Missing Tasks = 
VAR SelectedMonth = SELECTEDVALUE('MonthTable'[Month])
VAR TasksWithMonth = CALCULATETABLE(VALUES(ProgressTable[TaskID]), ProgressTable[Month] = SelectedMonth)
RETURN
CONCATENATEX(
    EXCEPT(VALUES(MainTable[TaskID]), TasksWithMonth),
    MainTable[TaskID],
    ", "
)

(3) Then the result is as follows.

vtangjiemsft_3-1699844291932.pngvtangjiemsft_4-1699844303252.pngBest Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Thanks! This looks like it will give me the results I need. I'm testing it out, but for some reason I keep getting an error "Function EXCEPT does not support joining a column of type Text with a column of type Integer. This seems to happen when I try to put the measure in a visual. Not sure what is causeing it. I am using the same data types that you have in your example solution. I notices however that your measure is in a text format but mine keeps defaulting to whole number without any way to change it. I'll keep playing with this to see if I can get it to work. 

Hi @ShawnHarrison ,

 

You can check if the TaskID field of the ProgressTable and MainTable is of numeric type.

vtangjiemsft_0-1699926429012.pngvtangjiemsft_1-1699926460103.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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