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
vanquisher11
Frequent Visitor

Dividing rows

Hi All,

 

Table is set up like this.

 

measure 1      measure 2     year 1    year 2    year 3

Flower            rose               5            3           1

Flower            lily                 0             1          6

Flower            aster              2            5           4

Trees              pine               3            5           8

Flower            coconut         2            6           0

Flower            mango          9             7          3

 

Now I want to divide the total sum of Flower with regards to trees sum(flower)/sum(trees) such that the table will show

 

measure 1       year 1    year 2    year 3

Flower/trees      2            2           1

 

how do I create a dax measure to divide rows?

 

Thank you!

 

Kind Regards,

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

You should unpivot your year columns.

 

Then you can do something like this:

 

Flowers/trees = CALCULATE(SUM('FlowersTrees'[Value]),'FlowersTrees'[Measure1]="Flower")/ CALCULATE(SUM('FlowersTrees'[Value]),'FlowersTrees'[Measure1]="Trees")

I do not get the numbers that you presented in your solution though from the data you provided.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

You should unpivot your year columns.

 

Then you can do something like this:

 

Flowers/trees = CALCULATE(SUM('FlowersTrees'[Value]),'FlowersTrees'[Measure1]="Flower")/ CALCULATE(SUM('FlowersTrees'[Value]),'FlowersTrees'[Measure1]="Trees")

I do not get the numbers that you presented in your solution though from the data you provided.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors
Top Kudoed Authors