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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
learnerdax
Regular Visitor

Matrix Hierarchy measure totals wrong for divide

Hi Dax experts,

 

I need help with Matrix measure totals , im getting wrong totals for Hierarrchy, if i use divide in measure,Please help me with this.Need calculate total for Country wise as well as by state and by City.Pleae could any of you help me with this.

learnerdax_2-1680794079099.png

 



learnerdax_1-1680793954142.png

 

4 REPLIES 4
tamerj1
Super User
Super User

Hi @learnerdax 

does that also mean, the country values in the first matrix is wrong? It sould be always the sum of its states and the state should always be the sum of its cities?

Yes, in First Matrix Sales/Qty and down matrix 
USA - 550(State Cal -350+Flo -100+Tx-100)
UK   - 300(same for UK states)
total -850

@learnerdax 

If so please try

Sales/Qty =
SUMX (
SUMMARIZE ( Hierarchy, Hierarchy[Country], Hierarchy[State], Hierarchy[City] ),
CALCULATE ( DIVIDE ( SUM ( Hierarchy[Sales] ), SUM ( Hierarchy[Qty] ) ) )
)

Thank you so much @tamerj1 ,It worked.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.