Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
Solved! Go to Solution.
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"
)
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.
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"
)
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |