Forum Discussion
vikrammankar
4 years agoFrequent Visitor
How to calculate Sales%
Hi,
I have below table for Sales with three columns, Month, Country & Sales_Amt.
I want to create two measures Total_Sales (Sum of all rows in the table) & Sales%. Can somebody help me with this. Last two columns should be measures and not columns. I have given these 2 columns for reference only, to tell what output I need.
| Month | Country | Sales_Amt | Total_Sales | Sales% |
| Jan-21 | US | 10 | 210 | 4.76% |
| Feb-21 | US | 20 | 210 | 9.52% |
| Mar-21 | US | 30 | 210 | 14.29% |
| Jan-21 | Canada | 40 | 210 | 19.05% |
| Feb-21 | Canada | 50 | 210 | 23.81% |
| Mar-21 | Canada | 60 | 210 | 28.57% |
Best Regards,
Vikram.
Hi vikrammankar ,
Add the following two measures:
Total Sales = CALCULATE(SUM('Table'[Sales_Amt]), ALL('Table'[Country],'Table'[Month])) % sales = DIVIDE(SUM('Table'[Sales_Amt]), 'Table'[Total Sales])
2 Replies
- MFelix
Super User
Hi vikrammankar ,
Add the following two measures:
Total Sales = CALCULATE(SUM('Table'[Sales_Amt]), ALL('Table'[Country],'Table'[Month])) % sales = DIVIDE(SUM('Table'[Sales_Amt]), 'Table'[Total Sales])- vikrammankarFrequent Visitor
Thanks a lot man. That helped. 😊😊