Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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?
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.
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
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!!
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)
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
9 | |
6 |