Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

OR in an IF Statement

Hi everyone, 

 

I have a need to ensure that the TTSCORE shows value in the graph only if one value is selected in the "Unit" filter or 

 

Default =
IF(OR((HASONEFILTER(Unit[Unit]),(HASONEFILTER(Site[Site])) ,SUM(GraphPlot[TTSCORE]), 0)
))
  • I got lost in all the parentheses. Is this what you're trying to write?

     

    Default =
    IF (
        HASONEVALUE ( Unit[Unit] ) || HASONEVALUE ( Site[Site] ),
        SUM ( GraphPlot[TTSCORE] ),
        0
    )

3 Replies

  • I got lost in all the parentheses. Is this what you're trying to write?

     

    Default =
    IF (
        HASONEVALUE ( Unit[Unit] ) || HASONEVALUE ( Site[Site] ),
        SUM ( GraphPlot[TTSCORE] ),
        0
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      I think so Alexis! you are awesome. I did not know you can do it this way!

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Alexis

       

      I have further expanded the measure as below but it is not working!

       

      TotalScore =
      IF (
      HASONEFILTER ( Unit[Unit] ) || HASONEfilter ( Site[Site] ) || HASONEfilter ( SystemTotalScore[SYSTEM] ) || SELECTEDVALUE(System[System]) <> "Multiple Selections",
      SUM ( SystemTotalScore[TTSCORE] ),
      0
      )
       
      The "system" filter, i have selected from the "format" tab to have the "select all" turned on, but when we select multiple System, the graph need to show TTSCORE as 0 and i could not figure out. CAn you help?