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

Combination Summarized and ALLSELECTED function not working

Hi all, 

 

I am dealing with the following Challenge. I am trying to determine the number of SKUs within a category that are not reaching the 15% NOS contribution target. It sounds quite easy. However, I want to use an allselected function in de denominator for the NOS contribution so that it will be recalculated if we filter on Category using a slicer. In the 2 screenshots of the report below, the "Below threshold 0.15" is working fine, however the counter is only working for the grand total but it isn't working per category nor per SKU... Apparently, the ALLSELECTED is ignored there and it will return a 100% for the NOS contribution in each line of the table... 

 

I have used the following calculations: 

Contribution NOS = DIVIDE(
sum(Sheet1[NOS]),
CALCULATE(sum(Sheet1[NOS]), allselected(Sheet1)))
Below threshold 0.15 = if([Contribution NOS] < 0.15,1,0)
counter =
sumx( SUMMARIZE(Sheet1, Sheet1[SKU], "below threshold", [Below threshold 0.15]), [below threshold]).
 
It would be really helpful if anyone can share any suggestion how this could be handled. Thank you.
 
Best regards,
Peter

peterbeere_0-1626258546933.png

peterbeere_1-1626258749379.png

I have used the following sample data 

CategorySKUNOS
A18
A25
B33
B46
C54
C69
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi all,
I found a solution for my issue. The thing that I had to do is creating a variabe outside the summarize function. In this way, the allsellected function was not ignored anymore since it was fixed.

I used the following DAX formula:

Solution =
var var1 = CALCULATE(sum(Sheet1[NOS]), ALLSELECTED(Sheet1))
return
sumx( SUMMARIZE(Sheet1, Sheet1[SKU], "below threshold",
if(
DIVIDE(
sum(Sheet1[NOS]),
var1)
< 0.15,1,0)), [below threshold])
 
Hopefully it will help someone that encounters a similar issue

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi all,
I found a solution for my issue. The thing that I had to do is creating a variabe outside the summarize function. In this way, the allsellected function was not ignored anymore since it was fixed.

I used the following DAX formula:

Solution =
var var1 = CALCULATE(sum(Sheet1[NOS]), ALLSELECTED(Sheet1))
return
sumx( SUMMARIZE(Sheet1, Sheet1[SKU], "below threshold",
if(
DIVIDE(
sum(Sheet1[NOS]),
var1)
< 0.15,1,0)), [below threshold])
 
Hopefully it will help someone that encounters a similar issue
Jihwan_Kim
Super User
Super User

Picture1.png

 

Link to the pbix file 

 

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Anonymous
Not applicable

Hi Jihwan_kim,
Thanks for your reply. However, it does not solve my issue. The issue that I encounter is that my counter is not working properly. It only works in the row total but it isn't able to count the number of skus below threshold per category. eg, in example1 without filters, it should result in counter = 1 for category A,B and C. and in example2, incl filter category is not A, it should give 1 only for category B

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.