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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.