Forum Discussion

dw700d's avatar
dw700d
Post Patron
2 years ago
Solved

if statement help

I would like to create an if statement measure and place it in a card. The measure would say if the total amount of any Acct Cd is above 0 then Fail else Pass. So for example the table below would return Fail because the total sum of Acct Cd  C is 20

 

Acct Cd      Amount
A0
B20
B-30
C20
  • dw700d add a measure like this:

     

    Fail/Pass Measure = 
    VAR __Check = 
    COUNTROWS ( 
        FILTER ( SUMMARIZE ( Table, Table[Acct Cd], "@Amt", SUM ( Table[Amount] ) ), [@Amt] > 0 )
    )
    RETURN IF ( __Check > 0, "Fail", "Pass" )

1 Reply

  • dw700d add a measure like this:

     

    Fail/Pass Measure = 
    VAR __Check = 
    COUNTROWS ( 
        FILTER ( SUMMARIZE ( Table, Table[Acct Cd], "@Amt", SUM ( Table[Amount] ) ), [@Amt] > 0 )
    )
    RETURN IF ( __Check > 0, "Fail", "Pass" )