Forum Discussion
Fact Table have a same column for Revenue, Standard Cost
- Anonymous2 years ago
Hi sam_gift ,
You can create a measure as below to get it:
GM % = VAR _revenue = CALCULATE ( SUM ( 'Table'[reporting_currency] ), FILTER ( 'Table', 'Table'[rep_id] IN { 1, 2, 3, 4 } ) ) VAR _standardcost = CALCULATE ( SUM ( 'Table'[reporting_currency] ), FILTER ( 'Table', 'Table'[rep_id] IN { 5, 6, 7, 8 } ) ) RETURN DIVIDE ( _revenue - _standardcost, _revenue )If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi sam_gift ,
You can create a measure as below to get it:
GM % =
VAR _revenue =
CALCULATE (
SUM ( 'Table'[reporting_currency] ),
FILTER ( 'Table', 'Table'[rep_id] IN { 1, 2, 3, 4 } )
)
VAR _standardcost =
CALCULATE (
SUM ( 'Table'[reporting_currency] ),
FILTER ( 'Table', 'Table'[rep_id] IN { 5, 6, 7, 8 } )
)
RETURN
DIVIDE ( _revenue - _standardcost, _revenue )
If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards