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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
teedee29
Frequent Visitor

How to perform "left join" filter?

I have the following measure in Table A:
Task Count = COUNTROWS(FILTER('Table B',CONTAINS('Table A',[Work Item Id],'Table B'[Parent Work Item Id])))
 
There's nothing wrong with the measure, but when I add the "task Count" measure to a grid that contains ALL fields from Table A thus far, the data will be filtered to only return data that has task count > 0. If there anyway I can do this where it will return Task Count of 0 if there are no matching records in Table B?
1 ACCEPTED SOLUTION

The first option +0 did not work since it did some kind of cartesian and listed all the data from Table B. The second option ideally would work but I coudln't find the "show items with no data" when i click on the column in the grid and it didn't have that option.

 

teedee29_0-1607603175778.png

 

I ended up trying this:

add new column = 

CALCULATE(COUNT('Table B'[Work Item Id]), FILTER('Table B', [Parent Work Item Id] = 'Table A'[Work Item Id]))
 
Then i set the new column in the grid display as "don't summarize"

View solution in original post

2 REPLIES 2
AllisonKennedy
Super User
Super User

@teedee29 If I understand your question correctly I think you have a couple options:

 

Option A: Add zero to your measure: 

Task Count = COUNTROWS(FILTER('Table B',CONTAINS('Table A',[Work Item Id],'Table B'[Parent Work Item Id]))) + 0

 

Option B: To show blank, (not zero), you can use the "Show Items with no data" option. 

 

If that doesn't work, let me know what result that gives and why it's wrong, and how the tables A and B are related


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

The first option +0 did not work since it did some kind of cartesian and listed all the data from Table B. The second option ideally would work but I coudln't find the "show items with no data" when i click on the column in the grid and it didn't have that option.

 

teedee29_0-1607603175778.png

 

I ended up trying this:

add new column = 

CALCULATE(COUNT('Table B'[Work Item Id]), FILTER('Table B', [Parent Work Item Id] = 'Table A'[Work Item Id]))
 
Then i set the new column in the grid display as "don't summarize"

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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