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?
lbendlin
2 years agoSuper User
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, the formula is OK.
I only tried to import the table and run the formula from it and it works.
Obviously, the problem is when I want to run a formula from the model where the union tables are derived. Then a message appears.
I will try to do the data transformation in a different way first and I think it will work then. Thank you very much for your help.