Forum Discussion

dejanzoric's avatar
dejanzoric
Frequent Visitor
2 years ago
Solved

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...
  • lbendlin's avatar
    lbendlin
    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?