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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
KC_MS
Frequent Visitor

use the selectedvalue of a slicer from a disconnect table to filter data in another table and chart

new to power bi and need some help~

i have 2 tables, simplified as below

tbl_RE

KC_MS_0-1718730367077.png

tbl_hierarchy

KC_MS_1-1718730400214.png

what i'm trying to do is to create sth like this 

KC_MS_2-1718730450402.png

the left is a slicer base on tbl_hierarchy, middle and right is data table and chart both based on data from tbl_RE
when user pick a value from the slicer (let say Entity 1), the table and the chart should refresh accodingly to include only records related to Entity 1.
Another thing here is "Groupwide" actually means all entities under the group and "ALL APAC" means all entities in APAC, so no matter which entity the user selected, these 2 should be included.

so if user picked Entity 1 from the slicer, the table should refresh to only show RE1, RE3, RE4 and RE5 and the chart should also be refresh to only include show RE1, RE3, RE4 and RE5.

 

i tried to create a measure to filter the table, which "seems" work on filtering the table but it doesn't work on the chart...

 

appreciate if anyone could help~~ Thx

 

 

P.S. i know it's much better to provide sample workable data and i created a pibx. but my IT guy did a good job to block all the online storage i know... so sorry for the inconvenience

 



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@KC_MS 
I am glad to help you.

You can refer to my test results below, where I labeled the data by creating a measure and filtered the data by the value of the measure, while the slicer was only used to pass in the filtering criteria, and had no filtering functionality of its own

here is my DAX code:

M_ =

VAR selected_=SELECTCOLUMNS('tbl_hierarchy','tbl_hierarchy'[Name])

VAR selected_oneValue=SELECTEDVALUE('tbl_hierarchy'[Name])

VAR table_value=MAX('tbl_RE'[Impacted_Entities])

VAR result_=

IF(MAX('tbl_RE'[Impacted_Entities])IN selected_ ||MAX('tbl_RE'[Impacted_Entities])="ALL APAC"||MAX('tbl_RE'[Impacted_Entities])="Groupwide",

1,0)

RETURN

SWITCH(TRUE(),

result_=1,1,

CONTAINSSTRING(table_value,selected_oneValue),1,

0

)

vjtianmsft_0-1718764920211.png

 

Add a filter of M_=1 to both visual "filter" fields.

vjtianmsft_1-1718764938533.pngvjtianmsft_2-1718764946343.pngvjtianmsft_3-1718764957005.pngvjtianmsft_4-1718764968568.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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
Anonymous
Not applicable

Hi,@KC_MS 
I am glad to help you.

You can refer to my test results below, where I labeled the data by creating a measure and filtered the data by the value of the measure, while the slicer was only used to pass in the filtering criteria, and had no filtering functionality of its own

here is my DAX code:

M_ =

VAR selected_=SELECTCOLUMNS('tbl_hierarchy','tbl_hierarchy'[Name])

VAR selected_oneValue=SELECTEDVALUE('tbl_hierarchy'[Name])

VAR table_value=MAX('tbl_RE'[Impacted_Entities])

VAR result_=

IF(MAX('tbl_RE'[Impacted_Entities])IN selected_ ||MAX('tbl_RE'[Impacted_Entities])="ALL APAC"||MAX('tbl_RE'[Impacted_Entities])="Groupwide",

1,0)

RETURN

SWITCH(TRUE(),

result_=1,1,

CONTAINSSTRING(table_value,selected_oneValue),1,

0

)

vjtianmsft_0-1718764920211.png

 

Add a filter of M_=1 to both visual "filter" fields.

vjtianmsft_1-1718764938533.pngvjtianmsft_2-1718764946343.pngvjtianmsft_3-1718764957005.pngvjtianmsft_4-1718764968568.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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



thx @Anonymous ~
it works perfect~

if you have some spare time and if you don't mind, can you explain a bit more on your DAX code and how it works?
especially on those "MAX" which i don't quite get what it does here and the purpose?

on a side note, what if i want to allow user to select multiple entities from the slicers?

 

thanks again for your help~

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.