I have the following columns
Code | Amount
TY123 | 30
TY456 |60
TY789 |80
and so on
I want to find a percentage I have to divide the distinct count of column Code by Total Spends ( Which is coming from a different table ) for each country ( Coming from a different table ) * 100
The resulting table should look like
Country | Code %
A |43%
B | 56%
And so on
How Do I go about this? I am highly confused. I tried the following measure but it is giving me wrong result[error : The function SUM cannot work with TYPE string]
#measure = DIVIDE(SUM('Table'[Code]),SUM('Table2'[Total Spends]))*100
Any help is highly appreciated.