Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Thanks in Advance.
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)
)
The slicer table:
The test data:
When the slicer does not make a selection (default select all), or when you click selected all, the system prompts an error message:
When the corresponding month filter date is selected, the data for the corresponding date is displayed using the markup result of measure:
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.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.