I am working on a Power BI report and facing an issue with dynamic button text that is dependent on the filter state of a date field.
Here are the details:
I have a table named ‘Jobs’ with columns ‘Entry Date’ and ‘Total’.
I have created a measure to sum the ‘Total’ column.
I have a line chart with ‘Entry Date’ (formatted as mm/yyyy) on the x-axis and the ‘Total’ measure on the y-axis.
I have two buttons with DAX formulas to change their text based on the filter status of ‘Entry Date’:
Drill Through Button Text =
VAR IsEntryDateFiltered = HASONEFILTER('Jobs'[Entry Date])
RETURN
IF(
IsEntryDateFiltered,
"Click Here",
"Select Filter"
)
Here is the second measure:
UserDrill Through Button Text Navigation =
VAR IsEntryDateFiltered = HASONEFILTER('Jobs'[Entry Date])
RETURN
IF(
IsEntryDateFiltered,
"Page 2",
""
)
The issue is that when a user clicks a marker on the line chart, which applies a filter on the ‘Entry Date’, the button text is not updating to “Click Here” as intended.
Please find a link to the file below:
https://www.mediafire.com/file/lngumfrit7puqy2/Navigation.pbix/file
I suspect the problem might be related to how the ‘Entry Date’ field is being filtered when interacting with the line chart. It seems like the HASONEFILTER function is not recognizing the filter context applied from the chart interaction.
Could anyone suggest what I might be doing wrong or how I can troubleshoot this issue further?
Any insights or assistance would be greatly appreciated!
Thank you in advance.