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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MohannadSh1996
Microsoft Employee
Microsoft Employee

Using filtered values in slicer as a variable to filter other tables using DAX functions

I have many tables with Ring column.

Ring
R1
R2
R3
R4


I want to have a slicer for Ring to filter all the graphs without making any relationships between the tables and with supporting multiple selections.

I'm thinking of using all the selected values in the slicer of Table1 as a parameter to filter Table2 values with DAX functions, like:

 

FilteredValueFromTable2 = 
CALCULATE(SUM('Table2'[Value]),FILTER(Table2, Table2[Ring] == All selected values from Table1 slicer))

 

 
But i don't know what to replace "All selected values from Table1 slicer" with.

i would appreciate if someone can help 😊

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @MohannadSh1996 

 

Try this.

FilteredValueFromTable2 = 
CALCULATE(
    SUM('Table2'[Value]),
    TREATAS( VALUES( Table1[Ring] ), Table2[Ring] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @MohannadSh1996 ,

 

How about use VALUES() function.

Measure = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Ring] in VALUES('Table (2)'[Ring])))

2.PNG3.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

@MohannadSh1996 , try like


FilteredValueFromTable2 =
CALCULATE(SUM('Table2'[Value]),FILTER(Table2, Table2[Ring] in Allselected(Table1[Ring])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak, What about: 

CALCULATE(SUM('Table2'[Value]), Table2[Ring] IN VALUES(Table1[Ring]))

@MohannadSh1996 , try and let us know the results

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak, This solution returned an error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

Mariusz
Community Champion
Community Champion

Hi @MohannadSh1996 

 

Try this.

FilteredValueFromTable2 = 
CALCULATE(
    SUM('Table2'[Value]),
    TREATAS( VALUES( Table1[Ring] ), Table2[Ring] )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Hi @Mariusz, Thanks for your post.

It seems that this worked, but it resulted a problem with graphs load dates. e.g., Some graphs have DataTime range (1st of March - Today data) but after adding TREATAS, they show a trimmed time range in the graphs, how is this related to the function?  

Hi @MohannadSh1996 

 

Never happened to me before with any Function as it is not related, but you can format your date time column as below.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

@Mariusz, The problem was that the Table1 is missing one of the Ring values that was exist in the other table, so, all the date related to this Ring will not be shown which will cause a trimming of data. (Fixed)

@amitchandak& @Anonymous, thanks for your answers 😊

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.