Forum Discussion

gauravnarchal's avatar
gauravnarchal
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Measure in If Statement and Return

  Hello – How can I create a measure to show   Convert column to Text   If Product code = Online or ONLINE return 10 or else "0"   Tabel Name = Sale   Name Branch Product Code (Me...
  • ChrisMendoza's avatar
    5 years ago

    gauravnarchal - This works for me:

    Measure = 
    IF(
        SELECTEDVALUE('Table'[Product Code]) = "Online",
        10,
        0
    )

    It does seem that from Power Query -> Power BI, "ONLINE" -> "Online" so I didn't have to account for that. Is it different for you?