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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

SUMX in case of filter conditions

Hi All, 
This time I have dificulties to create a Measure of  SUM of SAP_JAN[In co. code currency] in following case (filtrations)
SAP_JAN[Account] = Admin[Account Number] = Category List[Category Level 1] = "Material cost (indirect & claims)"

Below you can find model 

koooala_0-1617304888833.png

 

and DAX formula i have tried to implemend 

koooala_2-1617305651057.png

 

Thank you in advance for you reply. 

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I think you're making it a bit more complicated than it needs to be, but the main problem is the SELECTEDVALUE inside the FILTER makes the equality true for every row in the table you're filtering. Try removing that SELECTEDVALUE or go with something simpler like this:

Material cost (indirect & claims ) =
IF (
    SELECTEDVALUE ( 'Category List'[Category Level 1] ) = "Material cost (indirect & claims)",
    SUM ( SAP_JAN[In co. code currency] ),
    " "
)

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

I think you're making it a bit more complicated than it needs to be, but the main problem is the SELECTEDVALUE inside the FILTER makes the equality true for every row in the table you're filtering. Try removing that SELECTEDVALUE or go with something simpler like this:

Material cost (indirect & claims ) =
IF (
    SELECTEDVALUE ( 'Category List'[Category Level 1] ) = "Material cost (indirect & claims)",
    SUM ( SAP_JAN[In co. code currency] ),
    " "
)

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.