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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
The_dude2_0
Frequent Visitor

Filter doesn't give the correct result

 

Hello,

Just started to use Power BI 😊

 

In my report I use this DAX code:

ScorePerc100WKSum = 
var cat = SELECTEDVALUE(Pr[categorie])
return

CALCULATE
(
    [weightingfactorScore],filter(all(Pr), Pr[category] = cat)
)

For some reason it doesn't give the the expected result. It's close but not correct 28.80% should be 28.40%.
So I want to show the sum of weightingfactorScore for it's category.

 

The_dude2_0_0-1658317911553.png

weightingfactorScore is another measure I use in the DAX code above, which gives me a right result.

weightingfactorScore =
sum(productWegingsFactor[weightingfactor])* [Score] /100

So my repport is already filterted on a specifiek store through a slicer.

 

Am I overlooking something? Why doesn't it filter right?

5 REPLIES 5
Anonymous
Not applicable

Hi @The_dude2_0 ,

 

Please try this:

 

ScorePerc100WKSum =
VAR _cat =
    SELECTEDVALUE ( Pr[categorie] )
RETURN
    CALCULATE (
        [weightingfactorScore],
        FILTER ( ALL ( Pr[category] ), Pr[category] = _cat )
    )

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hey, Then I don't get any result, because it filters on the word cat then.

Anonymous
Not applicable

Hi @The_dude2_0 ,

 

Please try again:

ScorePerc100WKSum = 
VAR _cat =
    SELECTEDVALUE ( Pr[category] )
RETURN
    CALCULATE (
        [weightingfactorScore],
        Pr[category] = _cat  , ALLEXCEPT(Pr, Pr[category])
    )

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

VahidDM
Super User
Super User

Hi @The_dude2_0 

 

Try this:

ScorePerc100WKSum =
CALCULATE
(
    [weightingfactorScore],ALLEXCEPT(Pr, Pr[category])
)

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Hello,

If I use ALLEXCEPT then i still get the wrong result and it then shows me all product (my other filters are then gone)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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