Forum Discussion
JoyceW
3 years agoHelper II
Group by margin %
I have a table with sales order lines from the last 3 years. I have revenue and costs and measures to calculate the margin and margin percentage. now I would like to create a visual that shows how...
- 3 years ago
hi JoyceW
you would need
1) a table named Range like this:
Range Min Max <8% -100.00% 7.99% 8-10% 8.00% 10.00% >10% 10.01% 100.00% 2) add a calculated column in your table:
Year = YEAR(TableName[Orderdate])3) plot a matrix visual with necessary columns and three measures like:
Revenue2 = SUMX( FILTER( TableName, TableName[Margin%]<=MAX(Range[MAX]) &&TableName[Margin%]>=MAX(Range[MIN]) ), TableName[Revenue] ) OrderCount = COUNTROWS( FILTER( TableName, TableName[Margin%]<=MAX(Range[MAX]) &&TableName[Margin%]>=MAX(Range[MIN]) ) ) RevenueDiff = VAR _year = MAX(TableName[Year]) RETURN CALCULATE( [Revenue2], TableName[Year] = _year ) - CALCULATE( [Revenue2], TableName[Year] = _year -1 )it worked like:
qrasooli
3 years agoFrequent Visitor
You can create a new column and use an if statement and say if the margin is >0 and <=8% , result "Margin Below 8%". And go from there and add conditions and categories you would like e.g 8%-20%, 20%-30%, and so on and so forth, and from there sort your table by this column. Hope this helps. Let me know what you come up with.