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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
HamidBee
Power Participant
Power Participant

Issue with Button Text Not Updating Correctly When Selecting Dates in Hierarchical Date Properties o

Hello everyone,

 

I'm encountering an issue with a button text in Power BI not updating as expected when selecting points on a line chart that uses hierarchical date properties (Month and Year) from the actual_comp_date column. Here's the initial DAX formula I used:

 

Drill Through Button Text =
VAR IsFeatureTypeFiltered = HASONEFILTER('Jobs'[actual_comp_date])
VAR SelectedFeatureType = SELECTEDVALUE('Jobs'[actual_comp_date], "ALL")
RETURN
SWITCH(
TRUE(),
IsFeatureTypeFiltered && SelectedFeatureType <> "ALL", "Click Here",
"Select Filter"
)


The problem is that when I select a date (month or year) on the chart, the button text still reads "Select Filter" even though a date is clearly selected. This code works fine with non-date columns, indicating that the issue might be related to how date filters interact with hierarchical properties.. I attempted a modification to include checks for filtered hierarchy levels, as follows:

 

Drill Through Button Text =
VAR IsYearFiltered = ISFILTERED('Jobs'[actual_comp_date].[Year])
VAR IsMonthFiltered = ISFILTERED('Jobs'[actual_comp_date].[Month])
VAR IsDateFiltered = ISFILTERED('Jobs'[actual_comp_date])
VAR SelectedFeatureType = SELECTEDVALUE('Jobs'[actual_comp_date], "ALL")
RETURN
SWITCH(
TRUE(),
(IsYearFiltered || IsMonthFiltered || IsDateFiltered) && SelectedFeatureType <> "ALL", "Click Here",
"Select Filter"
)


However, this also didn't solve the problem. It seems that the hierarchy levels are not being recognized as filtered, even when selections are made on the chart.

 

Does anyone have insights on how to properly detect filters applied through hierarchical date properties in DAX? Any advice or workaround to get the correct button text to display would be greatly appreciated.

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @HamidBee ,

 

You can use the following dax, which requires a True and Flase determination for IsFeatureTypeFiltered.

Drill Through Button Text =
VAR IsFeatureTypeFiltered = HASONEFILTER('Jobs'[actual_comp_date])
VAR SelectedFeatureType = SELECTEDVALUE('Jobs'[actual_comp_date], "ALL")
RETURN
SWITCH(
TRUE(),
IsFeatureTypeFiltered = FALSE()&& SelectedFeatureType <> "ALL", "Click Here",
"Select Filter"
)

vyangliumsft_0-1714532554164.png

 

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @HamidBee ,

 

You can use the following dax, which requires a True and Flase determination for IsFeatureTypeFiltered.

Drill Through Button Text =
VAR IsFeatureTypeFiltered = HASONEFILTER('Jobs'[actual_comp_date])
VAR SelectedFeatureType = SELECTEDVALUE('Jobs'[actual_comp_date], "ALL")
RETURN
SWITCH(
TRUE(),
IsFeatureTypeFiltered = FALSE()&& SelectedFeatureType <> "ALL", "Click Here",
"Select Filter"
)

vyangliumsft_0-1714532554164.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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