Forum Discussion

android1's avatar
android1
Post Patron
10 years ago
Solved

Counting text values in 2 different Calculated Columns

Hi,

 

I have 2 calculated Columns -> InFull = IF([ActualDuration]<[ScheduledDuration]*.85,"Not In Full","In Full") 

Punctuality = IF (OTIF[DutyTimeFrom]<OTIF[TimeFrom]-1/24*.25,"Early",IF (OTIF[DutyTimeFrom]>OTIF[TimeFrom]+1/24*.25,"Late","On Time"))

 

I need to add the total number of times that the text 'In Full' appears & "On Time". I only want to add them if both appear.

  • Sean's avatar
    Sean
    10 years ago

    android1 This should work...

     

    In Full & On Time =
    COUNTROWS (
        FILTER ( 'OTIF', 'OTIF'[Punctuality] = "On Time" && 'OTIF'[InFull] = "In Full" )
    )

8 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Try this:

     

    InFullOnTime = CALCULATE(COUNT([SomeColumn]),FILTER(OTIF,OTIF[InFull] = "In Full"),FILTER(OTIF,OTIF[Punctuality] = "On Time"))
    • android1's avatar
      android1
      Post Patron

      Thanks for your reply. Can I use Count when dealing with strings? Getting the error attached.