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

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

Reply
Anonymous
Not applicable

Slicer with two columns to only filter element by one

Hi there,

 

I current have a slicer with two columns - 'Business', 'Project'. This means the slicer lets the user pick which project in a particular business to show details for. One of the details I show is the cost of the project.

 

I am now working on getting a datacard show the summed cost of all the projects within the selected business (so the user can see how significant the selected project is in a wider context). I am working on a measure, but I am struggling.

This is because when the slicer interacts with the datacard, the selected project is also filtering to the specific project selected. Instead, I want the project ignored and just the business selected.

 

I have tried coding it in DAX, but I can't seem to get it to work.

AllBusiness = SUMX(ALL(Table[Projectname]), SUM(Table[ProjectCost]))

This is returning a number far too large.

 

I have quite a few other context filters, on the report/page that need to be considered as well, so the straight 'ALL' doesn't work.

 

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found 

CALCULATE(
DISTINCTCOUNT(
Table[Project]
),
ALLEXCEPT(
Table,
Table[Busines],
Table[Cat]
)

to work.

View solution in original post

9 REPLIES 9
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Try this measure,

AllBusiness =
CALCULATE (
    SUM ( Table[ProjectCost] ),
    FILTER (
        ALL ( Table ),
        Table[Projectname] = SELECTEDVALUE ( slicer[Projectname] )
    )
)

 

Best Regards,

Community Support Team _Tang

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

Anonymous
Not applicable

Hi there,

 

How do you get the 'slicer' to work? 

Hi @Anonymous 

Thanks for your reply. If the measure doesn't work, could you share some sample data and the screenshot of slicer? Thanks. ( Otherwise we are just guessing....)

 

Best Regards,

Community Support Team _Tang

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

Anonymous
Not applicable

I found 

CALCULATE(
DISTINCTCOUNT(
Table[Project]
),
ALLEXCEPT(
Table,
Table[Busines],
Table[Cat]
)

to work.
jsaunders_zero9
Responsive Resident
Responsive Resident

Hi @Anonymous 

Does this help?

jsaunders_zero9_0-1651537576236.png

ProjectCosts = SUM(Projects[ProjectCost])
TotalProjectCosts = CALCULATE(Projects[ProjectCosts],ALL(Projects[Project]))

 

In your example it might look more like 

AllBusiness = CALCULATE(SUM(Table[ProjectCost]),ALL(Table[Projectname]))
Anonymous
Not applicable

Hi there,

 

I feel like this is what it should be too, however the resulting value of this is still far larger than the total cost of the business. 

Are you filtering on the business also (just noticed this in your first post)? Is it possible that the ALL() is causing the total to be a sum of all projects for all businesses? have you tried ALLEXCEPT?

Anonymous
Not applicable

I have tried all excpet, but there is about 5 other filters on the page that have to be included so I'm not entirely sure I've done it correctly.

I'll have a play around with it now.

Helpful resources

Announcements
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.

Top Kudoed Authors