Forum Discussion
dejanzoric
2 years agoFrequent Visitor
Ratio calculation from same column
The below screenshot is an example of sorted data where we have ID (LN_TAG) and value. I don't know how to make a percentage. The percentage represents the relationship: 01_Real estate/04_Tot...
- 2 years ago
according to DAXFormatter.com that code is ok
M = IF ( HASONEVALUE ( 'Sheet1'[CATEGORY] ), DIVIDE ( SUM ( 'Sheet1'[SUM_VECA_S4] ), CALCULATE ( SUM ( 'Sheet1'[SUM_VECA_S4] ), 'Sheet1'[CATEGORY] = "04_Total without duplicating value" ), 0 ) )do you still get the error message?
dejanzoric
2 years agoFrequent Visitor
Hi, first of all thank you for wanting to help me.
I am attaching a data table
| CATEGORY | SUM | % |
| 01_Real estate | 19.010.195 | |
| 02_Insurance policy | 40.228.138 | |
| 03_Real estate valuation | 6.820.222 | |
| 04_Total without duplicating value | 59.174.339 |
I want to calculate the percentage of participation in the total in the table
The percentage represents the relationship:
01_Real estate/04_Total without duplicating values
02_Insurance policy/04_Total without duplicating values
03_Real estate valuation/04_Total without duplicating values
04_Total without duplicating values/04_Total without duplicating values
01_Real estate/04_Total without duplicating values
02_Insurance policy/04_Total without duplicating values
03_Real estate valuation/04_Total without duplicating values
04_Total without duplicating values/04_Total without duplicating values
Thanks in advance,
Dejan
Dangar332
2 years agoResident Rockstar
hi, dejanzoric
try these one
% =
var num = SUM('Table'[SUM])
var deno = CALCULATE(SUM('Table'[SUM]),'Table'[CATEGORY]="04_Total without duplicating value ")
return
DIVIDE(num,deno)
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.