Forum Discussion
Need Help with Button Text Change Upon Date Filter in Power BI
- 2 years ago
For the first part i.e., updating the button text, you can do this.
a) change the measure
Drill Through Button Text = var _c1 = COUNTROWS( ALLSELECTED(Jobs[Entry Date])) var _c2 = COUNTROWS( VALUES ( Jobs[Entry Date] )) var _t = IF (_c1 <> _c2 && _c2 >= 1, CONCATENATEX ( VALUES ( Jobs[Entry Date] ) , [Entry Date] , ",") ) RETURN -- IF ( ISBLANK(_t), "Click Here", _t) IF ( ISBLANK(_t), "Select Filter", "Click Here")b) Select the button and go to the style button, change these settings
Test it, you will see the button changing !
For Part 2 i.e., second measure you can do similar changes and modify the destination setting. or upload the right file, where it is going wrong.
Hope this helps!
- 2 years ago
Thanks for the reply. The measure you made for 'Drill Through Button Text' does work however I was having an issue now with the navigation measure. It just wouldn't navigate to the desired page. I imagie it was due to the measure. So I changed it to this:
Drill Through Button Text = VAR IsEntryDateFiltered = ISFILTERED(Jobs[Entry Date]) || NOT(ISBLANK(SELECTEDVALUE(Jobs[Entry Date]))) RETURN IF(IsEntryDateFiltered, "Click Here", "Select Filter")So just to recall, the page navigation measure is:
User Drill Through Button Text Navigation = VAR IsEntryDateFiltered = ISFILTERED(Jobs[Entry Date]) || HASONEVALUE(Jobs[Entry Date]) RETURN IF(IsEntryDateFiltered, "Page 2", BLANK())
Thank you very much for your help though. It's greatly appreciated.
For the first part i.e., updating the button text, you can do this.
a) change the measure
Drill Through Button Text =
var _c1 = COUNTROWS( ALLSELECTED(Jobs[Entry Date]))
var _c2 = COUNTROWS( VALUES ( Jobs[Entry Date] ))
var _t = IF (_c1 <> _c2 && _c2 >= 1, CONCATENATEX ( VALUES ( Jobs[Entry Date] ) , [Entry Date] , ",") )
RETURN -- IF ( ISBLANK(_t), "Click Here", _t)
IF ( ISBLANK(_t), "Select Filter", "Click Here")
b) Select the button and go to the style button, change these settings
Test it, you will see the button changing !
For Part 2 i.e., second measure you can do similar changes and modify the destination setting. or upload the right file, where it is going wrong.
Hope this helps!
- HamidBee2 years agoPower Participant
Thanks for the reply. The measure you made for 'Drill Through Button Text' does work however I was having an issue now with the navigation measure. It just wouldn't navigate to the desired page. I imagie it was due to the measure. So I changed it to this:
Drill Through Button Text = VAR IsEntryDateFiltered = ISFILTERED(Jobs[Entry Date]) || NOT(ISBLANK(SELECTEDVALUE(Jobs[Entry Date]))) RETURN IF(IsEntryDateFiltered, "Click Here", "Select Filter")So just to recall, the page navigation measure is:
User Drill Through Button Text Navigation = VAR IsEntryDateFiltered = ISFILTERED(Jobs[Entry Date]) || HASONEVALUE(Jobs[Entry Date]) RETURN IF(IsEntryDateFiltered, "Page 2", BLANK())
Thank you very much for your help though. It's greatly appreciated.- sevenhills2 years agoSuper User
Glad to hear it helped. Regards