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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vinothkumar1990
Helper II
Helper II

Don't display the data in card visual when more than one filter value is selected

Hi,

 I have a client requirement. When a filter selected with more than one value then card visual should not display any data.

For example In the below model, If only one Month(i.e. January 2020) is selected then card visual should be displayed otherwise it should not display any data.

Note: All the filters should be in filter pane only.

 

Can you plese help me out?

vinothkumar1990_0-1625467804279.png

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@vinothkumar1990 , isfiltered and hasonevalue can help

 

measure =

var _cnt = calculate(distinctcount(Table[Month year]), allselected(Table))

return

if(isfiltered (Table[Month year] ) && _cnt >1 , blank(), [measure])

 

 

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

View solution in original post

v-xiaotang
Community Support
Community Support

Hi @vinothkumar1990 

I create a sample, and you can try like this.

vxiaotang_1-1625727609646.png

 

Measure = 
var _count=CALCULATE(DISTINCTCOUNT(ProductDetails[brand]),ALLSELECTED(ProductDetails))
return
IF(_count<>1,BLANK(),"measure")

 

result:

vxiaotang_0-1625727431600.gif

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.

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @vinothkumar1990 

I create a sample, and you can try like this.

vxiaotang_1-1625727609646.png

 

Measure = 
var _count=CALCULATE(DISTINCTCOUNT(ProductDetails[brand]),ALLSELECTED(ProductDetails))
return
IF(_count<>1,BLANK(),"measure")

 

result:

vxiaotang_0-1625727431600.gif

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.

amitchandak
Super User
Super User

@vinothkumar1990 , isfiltered and hasonevalue can help

 

measure =

var _cnt = calculate(distinctcount(Table[Month year]), allselected(Table))

return

if(isfiltered (Table[Month year] ) && _cnt >1 , blank(), [measure])

 

 

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

@amitchandak - Thanks for the help!

it worked when more than months are selected, but fails when nothing is selected or all are selected

vinothkumar1990_0-1625554965816.png

vinothkumar1990_1-1625555053988.png

vinothkumar1990_2-1625555090857.png

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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