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

Drillthrough based on disconnected table

I have a model where there is a fact table of transactions, a date table (related to fact table), and a disconnected date table (used for filtering).  The model structure is like the below:

 

StaceyLGriffeth_0-1646253989805.png

 

I have a report page filtered by the Disconnected Date Table.  I have a second page for drill-through.  I would like the drill-through to filter both for the selected account as well as the month of the trx date equal to the month of the selected value from the disconnected date table.  I am stuck on the latter... I have posted a mocked up dummy pbix here.  I appreciate any suggestions you may have.

 

Thanks!

 

4 REPLIES 4
bcdobbs
Super User
Super User

You need to pick the filter that gets passed up and "manually" apply it to the visual.

I wrote the following measure:

VisualFilter = 
VAR SelectedMonthEnd = SELECTEDVALUE ('DisconnectedDate'[MonthEndDate] )

VAR Result = 
    CALCULATE (
        INT ( NOT ( ISEMPTY ( Transactions ) ) ),
        'Date'[MonthEndDate] = SelectedMonthEnd
    )

RETURN Result


It reads the selected month end from the filter context and then checks if the transaction table is empty when MonthEndDate gets filtered by it. The NOT flips the logic found so it returns TRUE when there are records and then INT turns it to a 1/0.

Which can then be placed in the visual filter on your drill through page set equal to 1:

 

bcdobbs_0-1646256765841.png

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@bcdobbs Thank you so much for your suggestion!  I tried the first one:

 

VisualFilter =
VAR SelectedMonthEnd = SELECTEDVALUE ('DisconnectedDate'[MonthEndDate] )

VAR Result =
CALCULATE (
INT ( NOT ( ISEMPTY ( Transactions ) ) ),
'Date'[MonthEndDate] = SelectedMonthEnd
)

RETURN Result
 
I put that measure on a card and saw that it does accurately change 1/0 based on selection.  However, when I added it as a filter on the drillthrough visual, the drillthrough did not filter correctly.  When a date is selected from the slicer, the drillthrough is blank.  Do you have any suggestions?

Can you share your updated pbix. Will have a look.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Same idea but following would be more flexible if multiple months were selected:

VisualFilter = 
VAR SelectedMonthEnds = 
    TREATAS (
        VALUES ('DisconnectedDate'[MonthEndDate] ),
        'Date'[MonthEndDate]
    )

VAR Result = 
    CALCULATE (
        INT ( NOT ( ISEMPTY ( Transactions ) ) ),
        SelectedMonthEnds
    )

RETURN Result


Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

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.