cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KevinV91 Visitor
Visitor

Top N/Filter Greather Than adjusting Percentage Calculation

Goodmorning,

 

I'm quite new to PowerBi but couldnt find the solution to this question on the forum. I need some help with a percentage calculation (% Total Sales), which is affected by a Top N Filter. In the Base calculation the % sales calculation is going well since there are no filters. However when I filter the TOP5 the base where the sales is divded from is adjusted and the % of sales are changing. I would like to keep the % sales the same in the top 5 as in the base. I tried to do it with this DAX function:

 

 

 % Sales = (DIVIDE([Sales]; CALCULATE([Sales]; ALLSELECTED(Data[CUSTOMER]; Data[Sales]))

 

Thanks for the help.

 

Kind regards,

Kevin

 

 

BASE

#Customer% SalesSales
1A18,2%10000
2B16,4%9000
3C14,5%8000
4D12,7%7000
5E10,9%6000
6F9,1%5000
7G7,3%4000
8H5,5%3000
9I3,6%2000
10J1,8%1000

 

Filter TOP5

#Customer% SalesSales
1A25,0%10000
2B22,5%9000
3C20,0%8000
4D17,5%7000
5E15,0%6000

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Top N/Filter Greather Than adjusting Percentage Calculation

Hi @KevinV91 ,

 

We can create such a measure to meet your requirement.

 

% Sales = 
DIVIDE ( SUM ( Data[Sales] ), SUMX ( ALL ( Data ), Data[Sales] ) )

Check-value-against-entire-column-and-return-value-once-it-1.png

 

BTW, pbix as attached.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Top N/Filter Greather Than adjusting Percentage Calculation

Hi @KevinV91 ,

 

We can create such a measure to meet your requirement.

 

% Sales = 
DIVIDE ( SUM ( Data[Sales] ), SUMX ( ALL ( Data ), Data[Sales] ) )

Check-value-against-entire-column-and-return-value-once-it-1.png

 

BTW, pbix as attached.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (2,027)