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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Select measure when month is selected

Hi all, 

 

I would like to create a measure that says show all when no slicers are selected but when one slicer is selected, then show a measure. how would I do that? 

 

Thanks in advance! 

2 ACCEPTED SOLUTIONS
selimovd
Super User
Super User

Hey @Anonymous ,

 

try the following approach:

 

myMeasure =
IF(
    ISFILTERED( myTable[Slicer] ),
    [Measure when selected],
    [Measure for ALL]
)

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

First create a calculated table(Slicer) to summarize the slicer field(Product), then use the summarized field to create the slicer.
Then we create a measure and filter the measure in the filtering pane.

_isShow =
IF (
    ISFILTERED ( Slicer[Product] ),
    IF ( MAX ( 'financials'[Product] ) IN VALUES ( Slicer[Product] ), 1, 0 ),
    1
)

And the another measure what you need would be like this:

_Slicer = 
IF(ISFILTERED(Slicer[Product]),[Measure when selected],[Measure for ALL])

sample:

vangzhengmsft_0-1629703020687.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

First create a calculated table(Slicer) to summarize the slicer field(Product), then use the summarized field to create the slicer.
Then we create a measure and filter the measure in the filtering pane.

_isShow =
IF (
    ISFILTERED ( Slicer[Product] ),
    IF ( MAX ( 'financials'[Product] ) IN VALUES ( Slicer[Product] ), 1, 0 ),
    1
)

And the another measure what you need would be like this:

_Slicer = 
IF(ISFILTERED(Slicer[Product]),[Measure when selected],[Measure for ALL])

sample:

vangzhengmsft_0-1629703020687.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @Anonymous ,

 

try the following approach:

 

myMeasure =
IF(
    ISFILTERED( myTable[Slicer] ),
    [Measure when selected],
    [Measure for ALL]
)

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.