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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
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:

 

CoA.PNGEvent List.PNGFact table.PNGRelationship.PNGTable View.PNG 

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])))
 
Thanks so much in advance for all your help!! 😃

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Please modify your % of Revenue  formula like below.

% 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.

Capture.PNG

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.

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
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.

percentage for region.PNG

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.

Untitled.png

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. 

 

Capture.PNG

 

again, thanks so much!

Hi @Anonymous ,

Please modify your % of Revenue  formula like below.

% 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.

Capture.PNG

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.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.