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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Gross Margin Calculation

Hi I am trying to calculate the Gross Margin of Revenue / Non Revenue line items, my formula is below however it is not producing the desired result, hoping someone can help.

Gross Margin =
DIVIDE(
sum('Fact'[Actual])
,CALCULATE(sum('Fact'[Actual]), FILTER('Grouping','Grouping'[DBC_Grouping] = "Rental Revenue"))
,BLANK()
)

 

Desired Output:

Row LabelsSum of ActualGross Margin
Revenue261769796.6100.00%
Salaries-18338513.32-7.01%
Utilities-25995159.38-9.93%
Repairs & Maintenance-22138558.91-8.46%
Other Property Operating-53842110.66-20.57%
Grand Total141455454.454.04%

 

Output based on current formula:

Row LabelsSum of ActualGross Margin
Revenue261769796.6100.00%
Salaries-18338513.32 
Utilities-25995159.38 
Repairs & Maintenance-22138558.91 
Other Property Operating-53842110.66 
Grand Total141455454.4 
1 ACCEPTED SOLUTION
JarroVGIT
Resident Rockstar
Resident Rockstar

Try using ALL() in your filter statement;

 

DIVIDE(
sum('Fact'[Actual])
,CALCULATE(sum('Fact'[Actual]), FILTER(ALL('Grouping'),'Grouping'[DBC_Grouping] = "Rental Revenue"))
,BLANK()
)

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
JarroVGIT
Resident Rockstar
Resident Rockstar

Try using ALL() in your filter statement;

 

DIVIDE(
sum('Fact'[Actual])
,CALCULATE(sum('Fact'[Actual]), FILTER(ALL('Grouping'),'Grouping'[DBC_Grouping] = "Rental Revenue"))
,BLANK()
)

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




Anonymous
Not applicable

@JarroVGIT  Brilliant!!!  Thank you for that.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.