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
dokat
Post Prodigy
Post Prodigy

Sum divided by unique count

Hi,

I have data table in below format where i'd lke to calculate sum divided by unique count.  Basically sum of  dollar sales for Census Division then divide # of unique count of States.

For Ex: In below table South Atlantic sales total is $9,000, i would like this to be divided by 9 since there are 9  unique states  that belongs to the census division and result to be =9000/9 = 1000

 

StateCensus DivisionDollar Sales
AlabamaEast South Central100
ArkansasWest South Central200
ArizonaMountain300
CaliforniaPacific400
ColoradoMountain500
ConnecticutNew England600
District of ColumbiaSouth Atlantic900
DelawareSouth Atlantic800
FloridaSouth Atlantic900
GeorgiaSouth Atlantic1000
MarylandSouth Atlantic1100
North CarolinaSouth Atlantic1200
South CarolinaSouth Atlantic1300
VirginiaSouth Atlantic300
West VirginiaSouth Atlantic1400
KentuckyEast South Central1500
GeorgiaSouth Atlantic100
MassachusettsNew England1800
MaineNew England1800
MaineNew England2000
1 ACCEPTED SOLUTION
vojtechsima
Super User
Super User

Hi, @dokat ,
I believe Measure like this will do it:

DividedTotal = 
var _currentCensus = MAX(Financial[Census Division])
var _sum = SUM(Financial[Dollar Sales])
var _uniquestates = CALCULATE(DISTINCTCOUNT(Financial[State]),
    Financial[Census Division]=_currentCensus)

var _calculation = DIVIDE(_sum,_uniquestates)
return _calculation

vojtechsima_0-1646166522184.png

 






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

View solution in original post

2 REPLIES 2
vojtechsima
Super User
Super User

Hi, @dokat ,
I believe Measure like this will do it:

DividedTotal = 
var _currentCensus = MAX(Financial[Census Division])
var _sum = SUM(Financial[Dollar Sales])
var _uniquestates = CALCULATE(DISTINCTCOUNT(Financial[State]),
    Financial[Census Division]=_currentCensus)

var _calculation = DIVIDE(_sum,_uniquestates)
return _calculation

vojtechsima_0-1646166522184.png

 






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

@vojtechsima  Thank you it worked perfectly!

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.