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
Anonymous
Not applicable

Drilldown to detail Tab to display rows in table B not in table A-based on one common column

Drilldown to detail Tab to display rows in table B not in table A-based on one common column check produces wrong result.

 

I have this report referencing two tables: 

consumerExpenseCodes  &

producerConsumerExpenseCodes

 

ConsumerExpenseCodes  contains ALL expense codes.  

There are some expense codes in ConsumerExpenseCodes table which are not in producerConsumerExpenseCodes .

 

The following report count of distinct expensecodes in each table:

 

For each consumerName

Expense codes used by firm = expensecodes in producerConsumerExpenseCodes

Expense codes used by all firms = expensecodes in ConsumerExpenseCodes

Total potentialExpense codes = expensecodes in ConsumerExpenseCodes   but not in producerConsumerExpenseCodes

 

The challenge is to right-click on row Consumername and drill fown to a detail report list of all expensecode that belong to Total potentialExpense codes (7 in this case).   

 

Olajumi_0-1626106001403.png

Issue:  The requirement is to be able to drill down to "Detail - potential codes" page and see a list of expense codes that make up column "Potential difference".   Try drill down on consumer Accident Funded.  

 

PBIX link:  https://1drv.ms/u/s!AlMdRxAveLesgcFbY-CNnOQsTx8KjQ?e=EOIlL6

 

Observe the following issues:

1.  A consumer must have a confidence score of more than 500 to qualify to be in report. Added to filter pane. 

2.  Total in table is not adding up.  Also, total summary cards are only correct when you cross-filter by consumer name

3.  When you take out the ProducerId filter the detail page is messed up.  

 

I am following your solution on  Solved: Select rows not present in related table using a m... - Microsoft Power BI Community

Ii is not working.

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check if this is what you want:

Except Codes Measure =
VAR Code_ =
    MAX ( 'report consumerExpenseCodes'[expenseCode] )
VAR producerCodes_ =
    VALUES ( 'report producerConsumerExpenseCodes'[expenseCode] )
VAR consumerCodes_ =
    VALUES ( 'report consumerExpenseCodes'[expenseCode] )
VAR Except_ =
    EXCEPT ( consumerCodes_, producerCodes_ )
RETURN
    IF ( Code_ IN Except_, 1 )

codes.gif

 

 

Best Regards,

Icey

 

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

6 REPLIES 6
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check if this is what you want:

Except Codes Measure =
VAR Code_ =
    MAX ( 'report consumerExpenseCodes'[expenseCode] )
VAR producerCodes_ =
    VALUES ( 'report producerConsumerExpenseCodes'[expenseCode] )
VAR consumerCodes_ =
    VALUES ( 'report consumerExpenseCodes'[expenseCode] )
VAR Except_ =
    EXCEPT ( consumerCodes_, producerCodes_ )
RETURN
    IF ( Code_ IN Except_, 1 )

codes.gif

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

@Icey 

 

Thanks.  This dax works for the drill down column.  

Olajumi_0-1626198255508.png

Please observe what happend when you take out the producerId filter. 

The table columns are duplicated.  How can I fix this?   

 

 

Anonymous
Not applicable

 

I have this simple model:

 

Olajumi_0-1625763288821.png

 

Table report consumerExpensecodes (Table B) contains all rows (expensesCode column) of report producerConsumerExpenseCodes (Table A).      Tables are joined based  on the highlighted columns.

 

Problem: Based on consumerName, I need to create a report of (4colunms):  consumername, count of expenseCodes on both  Tables A & B and potentail difference.  

 

Olajumi_0-1626109384772.png

 

This is working well for the counts - Master report.  No issues.  

 

The challenge is to drill down on consumerName to extract detials of rows that make up the difference "Total potrentialExpense Codes".   That means expenseCodes in B but not A. 

 

I found and applied this solution online:  Solved: Re: DAX query to compare a value in one table to s... - Microsoft Power BI Community

 

Baed on that I created the following new column in  table (B)  report consumerExpensecodes

 

*Matched Column =
CALCULATE( COUNTROWS('report producerConsumerExpenseCodes'), FILTER('report producerConsumerExpenseCodes', 'report producerConsumerExpenseCodes'[ConsumerIdExpenseCode] = EARLIER('report consumerExpenseCodes'[ConsumerIdExpenseCode])) ) > 0

 

Result:  Unfortunately, This is returning True for all rows.   

 

There are definitely False situations.  I need urgent help, 🙂 

 

What am I doing wrong ?

 

Anonymous
Not applicable

This ticket is inadvertently duplicated and has been updated with sample PBIX as per:

 

Re: Drilldown to detail Tab to display rows in tab... - Microsoft Power BI Community

 

 

 

Anonymous
Not applicable

@Icey 

 

Thank you. I have tried to keep things simple.   Please find the PBIX attached. 

 

https://1drv.ms/u/s!AlMdRxAveLesgcFbY-CNnOQsTx8KjQ?e=EOIlL6

 

 

Issue:  The intention is to be able to drill down to "Detail - potential codes" page and see a list of expense codes that make up column "Potential difference".   Try drill down on consumer Accident Funded.  

 

Observe the following:

1.  A consumer must have a confidence score of more than 500 to qualify to be in report. Added to filter pane. 

2.  When you take out the ProducerId filter the detail page is messed up.  

 

 

 

 

 

 

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Could you create a sample .pbix file with the same issue for us to test? Please remove sensitive information and unnecessary parts.

 

Reference: How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,

Icey

 

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.

Top Solution Authors