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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kp27
New Member

how to add warning message if select all checkbox clicked on slicer

Hi All,

 

When I choose select all checkbox in slicer, Data in visual is reaching its limit,So I'm trying to add warning message if select all check box is clicked.  

Steps I followed, I tried creating DAX and adding warning message in it . And added  card visual to implement the warning message but this method doesnt helps.s there is any way to resolve it. 

kp27_0-1727482849317.png

Thanks in Advance.

1 REPLY 1
v-jtian-msft
Community Support
Community Support

Hi,@kp27 .I am glad to help you.

You can refer to my test case below where I use several common slicer processing approaches:
switch dynamically returns different cases, filtering the data based on the meausre value (set the value of the filter function's measure in filters = 1)
slicer multiple choice: using the values function
slicer options splicing: use the string concatenation function will be the target slicer in the selected value spliced into a string and to determine whether each line of data in the string

Here is my test code:

cardWarning = 
VAR _slicerValue= VALUES('SlicerTable'[slicerData])
VAR _slicerTable=CALCULATETABLE(
    VALUES('data_refreshTest'[refreshPoint]),FILTER(
        ALLSELECTED('data_refreshTest'),'data_refreshTest'[refreshPoint] in _slicerValue)
)
VAR _slicertext=  CONCATENATEX(VALUES('SlicerTable'[slicerData]), 'SlicerTable'[slicerData], ", ")
VAR TotalValuesRows = COUNTROWS(ALL('SlicerTable'[slicerData]))
VAR SelectedValuesRows = COUNTROWS(VALUES('SlicerTable'[slicerData]))
VAR _ifSelectedALL=IF(TotalValuesRows = SelectedValuesRows, 1, 0)
VAR _ifSelectedNone=IF(SelectedValuesRows=0 ,1 , 0)
VAR _today=TODAY()
VAR _threemonthsago=EOMONTH(_today,-3)+1
VAR _onemonthago=EOMONTH(_today,-1)+1
VAR _oneweekago=_today -7
VAR _tableDatePoint =MAX('data_refreshTest'[refreshPoint])
VAR _value01=CALCULATE(MAX('data_refreshTest'[refreshPoint]),FILTER('data_refreshTest','data_refreshTest'[refreshPoint]=_today))
VAR _value02=CALCULATE(MAX('data_refreshTest'[refreshPoint]),FILTER('data_refreshTest','data_refreshTest'[refreshPoint]<=_today && 'data_refreshTest'[refreshPoint]>= _oneweekago))
VAR _value03=CALCULATE(MAX('data_refreshTest'[refreshPoint]),FILTER('data_refreshTest','data_refreshTest'[refreshPoint]<=_today && 'data_refreshTest'[refreshPoint]>= _onemonthago))
VAR _value04=CALCULATE(MAX('data_refreshTest'[refreshPoint]),FILTER('data_refreshTest','data_refreshTest'[refreshPoint]<=_today && 'data_refreshTest'[refreshPoint]>= _threemonthsago))
RETURN 
SWITCH(TRUE(),
_ifSelectedALL=1,"warning:Please do not select “Selected All Or select other options on the slicer",
CONTAINSSTRING(_slicertext,"three months ago"),IF(_tableDatePoint=_value04,1,0),
CONTAINSSTRING(_slicertext,"a month ago"),IF(_tableDatePoint=_value03,1,0),
CONTAINSSTRING(_slicertext,"a week ago"),IF(_tableDatePoint=_value02,1,0),
CONTAINSSTRING(_slicertext,"nowadays"),IF(_tableDatePoint=_value01,1,0)
)

vjtianmsft_0-1727672135598.png

The slicer table:

vjtianmsft_1-1727672148590.png


The test data:

vjtianmsft_2-1727672162912.png

When the slicer does not make a selection (default select all), or when you click selected all, the system prompts an error message:

vjtianmsft_3-1727672197425.pngvjtianmsft_4-1727672204879.png

When the corresponding month filter date is selected, the data for the corresponding date is displayed using the markup result of measure:

vjtianmsft_5-1727672233415.png

 

vjtianmsft_6-1727672292121.png

 


I also found the article that meets your needs and have uploaded the test file, I hope it helps.

URL:
Display Custom Message in the Visual Until a Selec... - Microsoft Fabric Community

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors