Forum Discussion

neorobert's avatar
neorobert
Frequent Visitor
6 years ago
Solved

HELP needed with an advanced? custom formula

I’m trying to write a formula for the below measure, which pulls from a custom column and a measure. Maybe the formula needs to be written differently? That’s what the syntax is in the Excel workbook currently being used for this report.

 

Measure (the output would be a number):

RC Won = if('Data'[Final Reporting Status]="3-Won",'Data'[Won Reg],"")

Error: A single value for column 'Final Reporting Status' in table 'Data' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

                If I check all the values in the custom column, there are no blank rows or values other than the ones written in the below formula.

 

Referenced Custom Column for “Final Report Status” formula (no errors):

Final Reporting Status =

IF('Data'[Reporting Status]="Client Withdrew","5-CW",IF('Data'[Reporting Status]="Withdrew","6-AW",IF('Data'[Reporting Status]="Won","3-Won",IF('Data'[Reporting Status]="Lost","4-Lost",IF(AND('Data'[Reporting Status]="Pipeline",'Data'[Stage]="3B"),"2-Pipe",IF('Data'[Stage]="3B","3-Won",IF('Data'[Stage]="0A","1-Unqual",IF('Data'[Stage]="2B","2-Pipe",IF('Data'[Stage]="1","1-Unqual",IF('Data'[Stage]="2A","2-Pipe"))))))))))

 

 

“Won Reg” Measure (no errors):

                Won Reg = 'Data'[Total Net Revenue] * 'Data'[REG %]

  • When writing a measure, you need to use an aggregation when referring to a column, like:

     

    RC Won = if(MAX('Data'[Final Reporting Status])="3-Won",MAX('Data'[Won Reg]),"")

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    When writing a measure, you need to use an aggregation when referring to a column, like:

     

    RC Won = if(MAX('Data'[Final Reporting Status])="3-Won",MAX('Data'[Won Reg]),"")

  • Anonymous's avatar
    Anonymous
    Not applicable
    Try this:
    [RC Won]= CALCULATE([Won Reg], ‘Data’[Final Reporting Status] = “3-Won”)