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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joshua1990
Post Prodigy
Post Prodigy

Disabling Measure when selecting multiple filters

Hi experts,

 

I have a simple measure that counts the Sales for the past 2 weeks.

On the top of the report I have a slicer/ filter to select the weeks.

Is there any chance to get a 0 value when selecting multiple weeks?

 

Mutiple selections is active in the filter since the visual contains several measures.

 

 

 

2 ACCEPTED SOLUTIONS
ValtteriN
Super User
Super User

Hi,

You can accomplish for example by using HASONEFILTER. e.g. 

IF(HASONEFILTER('Calendar'[Week]),[Measure],0)

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

MargaritaG
Resolver I
Resolver I

Hey, 

If you do not want to change Slicer selection settings, maybe amend measure.
So If filter selection HASONEVALUE, then show, else 0

View solution in original post

7 REPLIES 7
v-xiaotang
Community Support
Community Support

Hi @joshua1990 

Try this,

test = 
IF (
    ISFILTERED ( 'Table'[Value] ) && NOT ( HASONEVALUE ( 'Table'[Value] ) ),
    0,
    1
)

vxiaotang_0-1643968686030.pngvxiaotang_1-1643968689864.pngvxiaotang_2-1643968692715.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

MargaritaG
Resolver I
Resolver I

Hey, 

If you do not want to change Slicer selection settings, maybe amend measure.
So If filter selection HASONEVALUE, then show, else 0

joshua1990
Post Prodigy
Post Prodigy

@ValtteriN : Thanks, but this will not work since there is a single selection on the filter. I just want to get a 0 when multiple selections are placed.

 

@joshua1990 

If you use a hierarchy + single select this should work by referencing the Week column. E.g.

ValtteriN_0-1643558520466.pngValtteriN_1-1643558535795.png

Value1 = if(HASONEFILTER('Calendar'[This week]),1,0)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




The slicer has to have the multiple selection option activated. Single selection as an option is not possible 

Could you share a screenshot of the issue? This method should also work with multiselect:

ValtteriN_0-1643561847069.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ValtteriN
Super User
Super User

Hi,

You can accomplish for example by using HASONEFILTER. e.g. 

IF(HASONEFILTER('Calendar'[Week]),[Measure],0)

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.