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
Dunner2020
Post Prodigy
Post Prodigy

Filter measures in the slicer

Hi there,

 

I have a measure that calculates the no of events. I have applied some inclusion rules at the page level. For example, only consider those rows where the column named 'NumberofCustomer' has a value greater than 0. Similarly, consider only rows where a column named 'Duration' has a value greater than 0. The filter at the page level is shown in the figure:

 

leo_89_0-1606780497573.png

 

I converted these inclusion rules into measures as shown below:

Zero Customer = CALCULATE(COUNTROWS('Sheet1'),FILTER('Sheet1','Sheet1'[NumberOfConsumers] <> 0) )
Duration Measure = COUNTROWS(FILTER('Sheet1','Sheet1'[Duration] >= 1) )
 
Now I want to apply these two measures at the page level in a way that either:
Two filter measures appear on the dropbox list and I select the measures OR
There is a radio button to enable or disable filters. When clicking on the enable filter option, the above mentioned filter measures trigger and apply at the page level.
 
Is there anyway of doing that in Power BI? Sample pibx file can be download from here

 

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Dunner2020 ,

 

I guess you want to use the slicer visual to achieve the functions you want, right? Sorry for that measure cannot be used in the slicer.

I try to solve this problem in my way, is this the result you want? 

 

1. Create two columns to mark.

Duration_flag = IF('Sheet1'[Duration] >= 1,1,0)
Zero Customer_flag = IF('Sheet1'[NumberOfConsumers] > 0,1,0)
 
2.Drag them into the field of two slicer .
 
Result:
 

v-yuaj-msft_0-1607044248947.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

5 REPLIES 5
v-yuaj-msft
Community Support
Community Support

Hi @Dunner2020 ,

 

I guess you want to use the slicer visual to achieve the functions you want, right? Sorry for that measure cannot be used in the slicer.

I try to solve this problem in my way, is this the result you want? 

 

1. Create two columns to mark.

Duration_flag = IF('Sheet1'[Duration] >= 1,1,0)
Zero Customer_flag = IF('Sheet1'[NumberOfConsumers] > 0,1,0)
 
2.Drag them into the field of two slicer .
 
Result:
 

v-yuaj-msft_0-1607044248947.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

@v-yuaj-msft 

Very helpful.  Thx for taking the time.

 

One addition which might help:
If you are using a table and not a spread sheet, you might write your measure like this:

"

Indicator Sequence =
VAR _EN =
    SELECTEDVALUE ( index_v01[Duration] )
RETURN
    IF( _EN >= 1, 1, 0 )

"

Dunner2020
Post Prodigy
Post Prodigy

@v-yuaj-msft , sorry for the confusion. I want to show those two filter as a checkbox on the page as shown below in the picture:

leo_89_0-1607023942092.png

 

So that when we click on either or both checkboxes it filters the data.

 

v-yuaj-msft
Community Support
Community Support

Hi @Dunner2020 ,

 

Sorry for that I'm still confused about what result you want to get, please provide me with more details about your problem and your desire result. From where I stand, the button does not seem to have such a function.

 

Is the following result you want?

 

Based on your description, you can do some steps as follows.

  1. Create two calculated tables.

 

Table = SUMMARIZE(FILTER('Sheet1','Sheet1'[Duration]<>0),[Duration])

Table 2 = SUMMARIZE(FILTER('Sheet1','Sheet1'[NumberOfConsumers]<>0),[NumberOfConsumers])

 

  1. Drag fields to “filters on this page”.

 

Result:

v-yuaj-msft_0-1606956640374.png

 

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

amitchandak
Super User
Super User

@Dunner2020 , Do this you have to do measure to dimension conversion using an independent table and bucketing. This also means you have to rebuild all the measures that will follow these buckets.

 

refer : https://www.youtube.com/watch?v=CuczXPj0N-k

or

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

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.