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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

prohibit multiple selection with a year slicer

Hello,

 

In table Calendar, I have the field named Fiscal Year.  Using a flag, I am able to restrict the use of the two last years.  For example, 2018 and 2019.  However, I would like to avoid the end-user to make multiple selections (2018 and 2019).  In Selection control, I have set show select all options to off.  Even that, using the ctrl key, the user can select 2018 and 2019.

 

Does someone know how to avoid that situation in order to permit to select either 2018 or 2019 but not both?

Regards,

alepage

2 REPLIES 2
Greg_Deckler
Super User
Super User

No way that I know of. However, you could enforce it on your measures by using HASONEVALUE and if not, return an error or BLANK perhaps.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello Greg,

 

I am not sure I understand what you are proposing.

What I have done it is to define two key measures as follow:

 

CurrentYear = Year(NOW())
StartingYear = Year(now()) - 1

 

Then in my table Calendar, I have define a new variable FlagFiscalYear.

 

FlagFiscalYear = SWITCH(true(),
'dim Calendar'[fiscalyear] = 'Key Measures'[StartingYear],1 ,
'dim Calendar'[FiscalYear] = 'Key Measures'[CurrentYear],2 ,
0)

 

Thereafter, I use a page filter where the FlagFiscalYear need to be greater then zero.

 

But the user can select both year, something I don't want.  You are proposing the use of hasonevalue but I don't know how to do that?  Can you provide me an example

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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