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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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