cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
snifer Member
Member

calculate account gp

account codecompanyamount
11999010
1599905
53999075
56999055
589990566
69999074
76999054
119991456
1599912545
539991445
5699914545
5899914456
69999145
76999145

 

given this table with account code company and amount

, i want be able to calculate for example for each company

the measure of account code 15999/58999

how i can do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: calculate account gp

Hi @snifer,

 

To create a measure as below.

 

Measure = 
VAR sum2 =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER ( Table1, Table1[account code] = 15999 )
    )
VAR sum1 =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER ( Table1, Table1[account code] = 58999 )
    )
RETURN
    sum2 / sum1

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

6 REPLIES 6
yelsherif Member
Member

Re: calculate account gp

Is there a relation between account codes, or you want to specifically calculate the values for 15999/58999, please elaborate

Highlighted
snifer Member
Member

Re: calculate account gp

I need to calculate the amount associated to account code 15999 / amount associate with 58999 associated to company 1 (456/4456) 

I need to calculate the amount associated to account code 15999 / amount associate with 58999 associated to company 0 (10/566)

yelsherif Member
Member

Re: calculate account gp

you can create a measure like:

Measure0 = divide(

       calculate(sum(accounts[amount]),accounts[account code] = 15999, accounts[company] = 0), 
       calculate(sum(accounts[amount]),accounts[account code] = 58999, accounts[company] = 0),
       0)

 

Measure1 = divide(

       calculate(sum(accounts[amount]),accounts[account code] = 15999, accounts[company] = 1), 
       calculate(sum(accounts[amount]),accounts[account code] = 58999, accounts[company] = 1),
       0)

snifer Member
Member

Re: calculate account gp

@yelsherif

 

on the example i put just 2 companies but i got more than 50 soi need measure to calculate for each company, making a measure for each company its not gonna work

Community Support Team
Community Support Team

Re: calculate account gp

Hi @snifer,

 

To create a measure as below.

 

Measure = 
VAR sum2 =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER ( Table1, Table1[account code] = 15999 )
    )
VAR sum1 =
    CALCULATE (
        SUM ( Table1[amount] ),
        FILTER ( Table1, Table1[account code] = 58999 )
    )
RETURN
    sum2 / sum1

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Community Support Team
Community Support Team

Re: calculate account gp

Hi @snifer ,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)