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

Is there a way to only apply a filter on a specific subset of your data?

I have a data table that includes present values for different operations within the company. Within the list I have current operations and several potetnial future projects. I have a stacked column chart which has business value from operations split over geographical region. What I would like to do is introduce a slicer with a list of the potential projects such that when they are selected, they are added to the data in the stacked column chart (in order to take a view of what the business would look like if the projects were completed). At the moment, when I have a slicer with list of projects, and I select one or two of them, it removes operational data from the chart. One way round it is to have "Operational" listed in the slicer and always selected, but I would rather not have the option to deslect it. Data looks like the following:

Region   Project           Value

US          Operational       100

UK          Operational       500

JP          Operational        20

UK          Project A           1

UK           Project B           3

UK          Project C           2 

US          Project D           5

 

So I would like the slicer to have Project A, Project B, Project C, Project D. When none are selected, only operational will show in the stacked chart. When Project A is selected, Operational and Project A are shown in the stacked chart.

 

I'm relatively new to Power BI so I might have missed something fundamental, but I cannot, yet, figure it out. Any help is greatly appreciated

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could try this way as below:

Step1:

you need a dim project table that does not contain "Operational", then do not create the relationship with fact table.

Step2:

Create a measure as below:

Measure = 
IF(ISFILTERED('Dim Project'[Project]),
CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Project] in VALUES('Dim Project'[Project]) ||'Table'[Project]="Operational")),
CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Project]="Operational"))
  )

Step3:

Now use project from dim table as a slicer and use this measure instead of value field in the visual

Result:

3.JPG4.JPG

 

and here is sample pbix file, please try it.

 

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.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could try this way as below:

Step1:

you need a dim project table that does not contain "Operational", then do not create the relationship with fact table.

Step2:

Create a measure as below:

Measure = 
IF(ISFILTERED('Dim Project'[Project]),
CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Project] in VALUES('Dim Project'[Project]) ||'Table'[Project]="Operational")),
CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Project]="Operational"))
  )

Step3:

Now use project from dim table as a slicer and use this measure instead of value field in the visual

Result:

3.JPG4.JPG

 

and here is sample pbix file, please try it.

 

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

Fantastic! That's exactly what I needed, thanks very much

hi @Anonymous 

You are welcome, could you please accept my reply as answer, that way, other community members would easily find the solution when they get same issues.  😁

 

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.
Greg_Deckler
Super User
Super User

Probably disconnect your slicer from your other visualization so that it does not filter. Then you could write your measure such that it includes all operational stuff and whatever projects are selected. You could also use ALL and essentially do the same thing if you do not disconnect the slicer from the visual.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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.