Forum Discussion
jaryszek
Super User
8 months agoHow to disable multiple selection with synced slicers?
Hello, This is my sample model: Link: https://drive.google.com/file/d/1xAOA3IPF9iaHEF11XrNkaJ9_TI7lwscO/view?usp=sharing In the Main Selector, I have Month and Date. And in the Daily...
FBergamaschi
Super User
8 months agoHi jaryszek,
I tried several ways and could not solve this.
The workaround could be to hide the values in the Daily view when multiple months are selected.
I would suggest to use year-month and not only month for obvious reasons
The code would be very simple
Sales Amount Single Month =
IF (
CALCULATE(
HASONEVALUE ( Dim_Date[YearMonth] ),
REMOVEFILTERS( Dim_Date[Day] )
),
SUM ( Fact_Sales[SalesAmount] )
)
You could also create a control measure that shows the user that the selection is not appropriate for that page with something like this
Control Single Month =
IF (
NOT
CALCULATE(
HASONEVALUE ( Dim_Date[YearMonth] ),
REMOVEFILTERS( Dim_Date[Day] )
),
"You selected multiple months, this is not allowed in this page so results have been blanked out",
"Month selection is OK (Single month)"
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- jaryszek8 months ago
Super User
Thank you very much, the simplest solutions are the best.