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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
bilingual
Helper V
Helper V

Use of measure in slicer

Hi, i would like to add a slicer where "percentage of total" is the value, however i can not make slicer work with meausure, any good hints? f

 

Fr example make a slice of following data,

So if slicer is set to include more than 14 percent, Name of operator A will be filtered out.

 

Name of operatorNumbers
A144
B557
C333
1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @bilingual 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can create a "Numeric range" parameter:

vyueyunzhmsft_0-1664949891292.png

vyueyunzhmsft_1-1664949903429.png

(3)Then we can create a measure to control the display of the data:

Flag = var _min_slice = MIN('Percentage'[Parameter])
var _max_slice = MAX('Percentage'[Parameter])
return 
IF(DIVIDE( SUM('Table5'[Numbers]) , CALCULATE( SUM(Table5[Numbers] ) , ALLSELECTED( 'Table5'))) > _min_slice/100 && DIVIDE( SUM('Table5'[Numbers]) , CALCULATE( SUM(Table5[Numbers] ) , ALLSELECTED( 'Table5'))) < _max_slice/100 , 1, 0)

(4)Then we can put the measure in the "Filter on this visual" and configure it and we can meet your need:

vyueyunzhmsft_2-1664949993729.png

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @bilingual 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We can create a "Numeric range" parameter:

vyueyunzhmsft_0-1664949891292.png

vyueyunzhmsft_1-1664949903429.png

(3)Then we can create a measure to control the display of the data:

Flag = var _min_slice = MIN('Percentage'[Parameter])
var _max_slice = MAX('Percentage'[Parameter])
return 
IF(DIVIDE( SUM('Table5'[Numbers]) , CALCULATE( SUM(Table5[Numbers] ) , ALLSELECTED( 'Table5'))) > _min_slice/100 && DIVIDE( SUM('Table5'[Numbers]) , CALCULATE( SUM(Table5[Numbers] ) , ALLSELECTED( 'Table5'))) < _max_slice/100 , 1, 0)

(4)Then we can put the measure in the "Filter on this visual" and configure it and we can meet your need:

vyueyunzhmsft_2-1664949993729.png

 

Best Regards,

Aniya Zhang

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

 

AnastasiaS
Resolver I
Resolver I

Hello @bilingual,

In some cases an approach could be using the What-if Parameters. Check this article:

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-what-if

 

You could define a "number range parameter", for example from 1 to 100, and based on the selected value, add a measure that will check if your values are less or more than the selected one.

 

You can get this kind of result (the Parameter can also be shown as a dropdown or classic list):

AnastasiaS_1-1664813840337.png

Regards,

Greg_Deckler
Super User
Super User

@bilingual In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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