The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I'm trying to calculate for % of total margin,
below is sample of data set:
base of the table, the total of percent is 7.44%, however when I do manual calculation from the raw file, it show 66%
when I check again, the total appear as average.
this is the formula I use to calculate margin :
Solved! Go to Solution.
you may take steps below for reference.
1. Create a column:
Col_divide = 'MAIN DATA TABLE'[profit_last] /'MAIN DATA TABLE'[nett_sales]
2. Then create the measure:
Margin =
IF (
HASONEVALUE ( 'MAIN DATA TABLE'[profit_last] ),
SELECTEDVALUE ( 'MAIN DATA TABLE'[Col_divide] ),
SUM ( 'MAIN DATA TABLE'[Col_divide] )
)
Result:
Hope this helps.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
you may take steps below for reference.
1. Create a column:
Col_divide = 'MAIN DATA TABLE'[profit_last] /'MAIN DATA TABLE'[nett_sales]
2. Then create the measure:
Margin =
IF (
HASONEVALUE ( 'MAIN DATA TABLE'[profit_last] ),
SELECTEDVALUE ( 'MAIN DATA TABLE'[Col_divide] ),
SUM ( 'MAIN DATA TABLE'[Col_divide] )
)
Result:
Hope this helps.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@shahidalaila23 , Mark as % is needed
try like
profit margin = divide( SUM('MAIN DATA TABLE'[profit_last]) , SUM('MAIN DATA TABLE'[nett_sales]) )
or
without %
profit margin = divide( SUM('MAIN DATA TABLE'[profit_last]) , SUM('MAIN DATA TABLE'[nett_sales]) )*100