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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.