Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

MEasure

Hi Guys,   i've created the below formula and it is working for only condition Unit = THM and not for Unit = DTH.   Does the formula picks only 1 condition at a time?   Annual Usage (DTH) = IF...
  • amitchandak's avatar
    5 years ago

    Anonymous , Use || or In

     

    Annual Usage (DTH) = IF (
    [typename] = "Nat Gas" && [Unit] = "THM" || [Unit] = "DTH",
    ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0, 0)

     

     

    Annual Usage (DTH) = IF (
    [typename] = "Nat Gas" && [Unit] in{ "THM" , "DTH" },
    ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0 ,0)

     

    added else part, change as per need

  • AlB's avatar
    5 years ago

    Hi Anonymous 

    Annual Usage (DTH) =
    IF (
        [typename] = "Nat Gas" && [Unit] IN { "THM", "DTH" },
        ROUND ( [AnnualUsage] / 10.0, 0 )
    ) + 0

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers