cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sabeensp Helper IV
Helper IV

Divide Rows by Rows

Hello,

 

I have a table Table 1

COL1 ----------     COL2

Local ----------  10

Global ---------- 20

Local ----------15

Local ---------- 30

Global ----------15

Global ----------10

 

What I'm trying to do is create a measure, where SUM COL2 where COL1 is Local gets  divided by SUM of CLO2 Where COL1 is Global

 

So basically SUM(Local.COL2) / SUM(Glocal.COL2)

 

Apprecite your help.

1 ACCEPTED SOLUTION

Accepted Solutions
camargos88 Community Champion
Community Champion

Re: Divide Rows by Rows

Hi @sabeensp ,

 

Try this code:

Measure = DIVIDE(CALCULATE(SUM('Table'[COL2]); 'Table'[COL1] = "Local") ; CALCULATE(SUM('Table'[COL2]); 'Table'[COL1] = "Global"); 0)
 
Capture.PNG
 
Ricardo

Did I answer your question? Mark my post as a solution!
Ricardo

View solution in original post

1 REPLY 1
camargos88 Community Champion
Community Champion

Re: Divide Rows by Rows

Hi @sabeensp ,

 

Try this code:

Measure = DIVIDE(CALCULATE(SUM('Table'[COL2]); 'Table'[COL1] = "Local") ; CALCULATE(SUM('Table'[COL2]); 'Table'[COL1] = "Global"); 0)
 
Capture.PNG
 
Ricardo

Did I answer your question? Mark my post as a solution!
Ricardo

View solution in original post

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors