cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Percentage of expenses on revenue

Hi guys,

Been wrecking my brain and the google for this, but can't seem to find a viable solution to this - so i've come to the source and hope you guys can help me find the solution to this seemingly simple problem.

I have 1 fact tabels and 2 dimension tables as shown on the embedded:

So what i'm trying to do here is to show the percentage of the costs on each region to the each region's revenue like the above table. But the formula just refuses to calculate it on the Cost 2, Cost 3 ... levels, but calculated fine on the Total level. The measures I used are as below:

Revenue = CALCULATE(sum('Fact Table'[Total Reforecast]), COA[Account Type]="Revenue")
CoS = CALCULATE([RF1], COA[Account Type] = "Cost of Sales")
% of Revenue = DIVIDE([CoS], CALCULATE([Revenue], all('Event List'[Region])))

1 ACCEPTED SOLUTION
Resident Rockstar

Hi @Anonymous ,

```% of Revenue =
DIVIDE (
[Cost for each region],
CALCULATE (
SUM ( 'Fact Table'[Total Reforecast] ),
FILTER ( ALL ( 'COA' ), COA[Account Type] = "Revenue" )
)
)
```

Then you could get your desired output.

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Resident Rockstar

Hi @Anonymous ,

Based on information, if you want to calculate the the percentage of the costs on each region to the each region's revenue. I'm afraid that your formula should be right.  The output based on your logic should like below.

However, in your matrix, you put the Account Category as Row field, I'm afraid that is it is the correct display.

As you could see, the highlight in red are null values, so the % percentage is blank but the total row is correct.

So what is your desired output? Please share your desired output so that I could understand your logic better and help further on it.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherry / @v-piga-msft

Thanks for your reply, the desired output for me is a % of Revenue by Cost item line as per below.

again, thanks so much!

Resident Rockstar

Hi @Anonymous ,

```% of Revenue =
DIVIDE (
[Cost for each region],
CALCULATE (
SUM ( 'Fact Table'[Total Reforecast] ),
FILTER ( ALL ( 'COA' ), COA[Account Type] = "Revenue" )
)
)
```

Then you could get your desired output.

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.