Forum Discussion
sur27078
11 months agoRegular Visitor
How to calculate % from single column
I'm currently working with a General Ledger (GL) dataset that includes only the following columns: Year, GL Account, Cost Center, Month, and Balance. I’ve created a visual card that filters data bas...
- 11 months ago
sur27078 You should be able to do something like the following:
Gross Margin % = VAR _TotalRevenue = CALCULATE( SUM( 'Table'[Balance]), ALL( 'Table' ) ) VAR _GrossProfit = CALCULATE( SUM( 'Table'[Balance] ), FILTER( ALL( 'Table' ), [GL_Account] IN { "5014", "4508" } ) ) VAR _Return = DIVIDE( _GrossProfit, _TotalRevenue, 0 ) RETURN _ReturnYou would need to modify this for whatever your GL_Account codes are for however you are filtering your Revenue and Gross Profit card visuals.
GeraldGEmerick
11 months agoSuper User
sur27078 You should be able to do something like the following:
Gross Margin % =
VAR _TotalRevenue = CALCULATE( SUM( 'Table'[Balance]), ALL( 'Table' ) )
VAR _GrossProfit = CALCULATE( SUM( 'Table'[Balance] ), FILTER( ALL( 'Table' ), [GL_Account] IN { "5014", "4508" } ) )
VAR _Return = DIVIDE( _GrossProfit, _TotalRevenue, 0 )
RETURN _ReturnYou would need to modify this for whatever your GL_Account codes are for however you are filtering your Revenue and Gross Profit card visuals.