Search code examples
powerbimeasure

How to do a measure %?


Team,

I'm trying to create a measure so I can pull over our Maintenance and repairs by % of revenue:

Z - Maint/Repairs % = sum('LSI DP_JP_HistorySummaryBySiteMaster'[Maint/Repairs]/[Z - JP TTM Rev. Copy])

I receive this error: 'The SUM function only accepts a column reference as an argument.'

Do you know what I'm doing wrong?


Solution

  • I am guessing [Z - JP TTM Rev. Copy] is a measure. The reason for the error are missing parenthesis and missing syntax.

    Sum('LSI DP_JP_HistorySummaryBySiteMaster'[Maint/Repairs])/([Z - JP TTM Rev. Copy])

    A better Measure is this

    measure =
    VAR _num =
        SUM ( 'LSI DP_JP_HistorySummaryBySiteMaster'[Maint/Repairs] )
    RETURN
        DIVIDE ( _num, [Z - JP TTM Rev. Copy] )