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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter a column(X) values based on another column(Y) which is a slicer

Here is the question :
If you select Year = 2018, all the data with Year=2018 will get filtered(yellow highlighted data), But I want the data which is present on right side as my output. 

According to me we need to have one measure which will compare 2018 with values in "Plan year" and gives output.

DAX should be something like this:

   

 Result = calculate(sum(Sales), Filter (SELECTEDVALUE(Table[year]) = substring (Table[PlanYear])))

I have sample data as below,

Any help is appreciated.

Thanks!!


Question.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks @v-lili6-msft for your efforts,

The one you posted should also work and meanwhile I have found other way as well. 

For that you need to

 

1. create calculated column 

2.

Planned_year_month_filtered = CONTAINSSTRINGEXACT('Plan Variance'[Planned_year_month],'Plan Variance'[Year])

3. Then drag the column under visual level filter and set it to "True"

The desired output is displayed!! Smiley Happy

 

But CONTAINSSTRINGEXACT is present in March 2019 release only.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

After my test, you could try this measure:

Measure = CALCULATE(SUM('Table'[Sales]),FILTER('Table',SEARCH(SELECTEDVALUE('Table'[Year]),'Table'[Plan year],1,0)>0))

Result:

2.JPG

here is sample pbix file, please try it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks @v-lili6-msft for your efforts,

The one you posted should also work and meanwhile I have found other way as well. 

For that you need to

 

1. create calculated column 

2.

Planned_year_month_filtered = CONTAINSSTRINGEXACT('Plan Variance'[Planned_year_month],'Plan Variance'[Year])

3. Then drag the column under visual level filter and set it to "True"

The desired output is displayed!! Smiley Happy

 

But CONTAINSSTRINGEXACT is present in March 2019 release only.

hi, @Anonymous 

It's pleasant that your problem has been solved, could you please mark the reply as Answered?

 

Best Regards,

Lin

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors