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
SteT82
New Member

Total of a column based on condition of another column

Hallo

I have a table like this

CUSTOMERTYPESALES
Aprio10
Bnormal5
Clow4
Dprio3

 

 

And I would like 1. to get a Dax function giving me the total of the sales of all the priority customers 2. only for the priority customers getting the percentage of its sales over the total of the prio sales

 

See ideal result:

CUSTOMERTYPESALESTOT PRIO SALES% on tot prio sales
Aprio101377%
Bnormal513 
Clow413 
Dprio31323%


Thanks!

1 ACCEPTED SOLUTION
JoeBarry
Solution Sage
Solution Sage

Hi @SteT82 

 

1st measure is to Create Priority Sales

 

Total Priorty Sales = CALCULATE(
                            SUM(test[SALES]), KEEPFILTERS(test[TYPE] = "prio"))

 

2nd measure is to create a Total Priorty Sales

Prio Sales = CALCULATE([Total Priorty Sales], ALL(test))

 

3rd Create % of Total

Tot Prio sales% = 
DIVIDE([Total Priorty Sales], [Prio Sales])

 

Convert the 3rd to %

 

JoeBarry_0-1692710391380.png

 

Thanks

Joe

 

View solution in original post

1 REPLY 1
JoeBarry
Solution Sage
Solution Sage

Hi @SteT82 

 

1st measure is to Create Priority Sales

 

Total Priorty Sales = CALCULATE(
                            SUM(test[SALES]), KEEPFILTERS(test[TYPE] = "prio"))

 

2nd measure is to create a Total Priorty Sales

Prio Sales = CALCULATE([Total Priorty Sales], ALL(test))

 

3rd Create % of Total

Tot Prio sales% = 
DIVIDE([Total Priorty Sales], [Prio Sales])

 

Convert the 3rd to %

 

JoeBarry_0-1692710391380.png

 

Thanks

Joe

 

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.