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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
PamelaAG
Frequent Visitor

How to use a measure in a slider filter a table

Dear users,

 

I would like to ask your feedback about how to use a measure into a slider in order to filter a table and some graphs.

 

I have created a measure called "Index Value" that return the values of 5, 3 and 1, the results are being shown on the table by customer and it is working perfectly.

 

The problem comes when I tried to used this results in a slicer to filter the table, in order to that, I created table called "INDEX INDICATOR" to which I gave them the following values

Index ColorIndex Number
Green1
Yellow3
Red5

 

Then I created another measure with the following formula

 

aIndex calculator =
var AAA = [Index Value]
RETURN
IF
(HASONEVALUE('INDEX INDICATOR'[Index Color]),
SWITCH(TRUE(),
VALUES('INDEX INDICATOR'[Index value])=1&&AAA=1,AAA,
VALUES('INDEX INDICATOR'[Index value])=3&&AAA=3,AAA,
VALUES('INDEX INDICATOR'[Index value])=5&&AAA=5,AAA),AAA
)
 
The conexiton doesn't work, everytime I click on any of the values, nothing is being filtered I cannot use at all the slicer.
 
Do you happen to know another way to do this or tell me what I am doing wrong?
 
Thank you in advance, 
Pamela
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @PamelaAG 

 

You should know that measure only returns a value, of course it won't have a filter effect.

If you want measure to filter table, you need to put it in filter pane.

I created a sample for reference.


Measure = IF([index value] in VALUES(Table2[index number]),1,0)

vjaneygmsft_1-1644304272605.png

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @PamelaAG 

 

You should know that measure only returns a value, of course it won't have a filter effect.

If you want measure to filter table, you need to put it in filter pane.

I created a sample for reference.


Measure = IF([index value] in VALUES(Table2[index number]),1,0)

vjaneygmsft_1-1644304272605.png

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

amitchandak
Super User
Super User

@PamelaAG , You need something like this with help from you base table having measure

Sumx(filter(values(Table[ID]), [measure] = max('INDEX INDICATOR'[Index Number])),[measure])

 

 

Check this, in place between you will have =

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Hi, thank you for your answer!

 

You mean I need to insert this formula into this other formula?:

aIndex calculator =
var AAA = [Index Value]
RETURN
IF
(HASONEVALUE('INDEX INDICATOR'[Index Color]),
SWITCH(TRUE(),
VALUES('INDEX INDICATOR'[Index value])=1&&AAA=1,AAA,
VALUES('INDEX INDICATOR'[Index value])=3&&AAA=3,AAA,
VALUES('INDEX INDICATOR'[Index value])=5&&AAA=5,AAA),AAA
)

@PamelaAG , Based on what I got, I want to reconsider the approach ,

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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