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

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

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
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.