Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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:
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!
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 Thank you so much for your suggestion! I tried the first one:
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