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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Invisibleman
Helper II
Helper II

how to set select all in the checkbox slicer thru the formula

Dear all,

 

For the power BI I am working on, I have an issue with the year selection and the charts I have. For so far, the charts are following the selected years, but when I start to de-select from the highest to the lowest year and all years are being de-selected, the chart is showing blank. But I want then that all the years become selected again by formula or at lesst the selected year will become the highest possible year, so the chart will not show up in blank. But I what ever I try, nothing sofar is helping.

See the picture in what I mean and also how I am trying to solve this problem.

The formula I am using is;

Highest Selected Year =
var InputYear = max('mapCalendar'[Year])
var InputYearString = format(InputYear,"####")
VAR test = iferror(convert(InputYearString,INTEGER),"")
VAR AnySelected = ISFILTERED(mapCalendar[Year])
VAR CountSelected = Countrows (values (mapCalendar[Year]))
Return if(or(anyselected=false,isblank(CountSelected)),format([Actual Current Year],"####"),InputYearString)

 

YearSelection.jpg

 

If anybody can help in this.

 

Thanks,

Hans

2 REPLIES 2
lbendlin
Super User
Super User

don't enable the "Select all" option

Hello Ibendlin,

 

I guess that will solve the problem, but it is not the solution I was looking for. As I do want to have the Select All inside as it will make it easier for others to work with the report. Then for now I will need to inform them, about the situation when it wil ocur.

 

But if there's anybody has any other solution, then please let me know. 

 

Regards,

Hans

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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