Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

IF Formula in Power BI

Hi All,   Im fairly new to Power BI and trying to build my own report/visual dashboard. I have 1 dataset where i want to insert IF formula to compare if column A is greater than column B then retu...
  • speedramps's avatar
    6 years ago

    Hi majmsk 

     

    Please consider one of these solutions and leave kudos

     

    Method 1)

    Add a conditional column in you M query

     

    Method 2)

    On the top menu bar>Click on Modelling>New measure and add these measures

     

    Total last = SUM(YourTableName[Last])

    Total current = SUM(YourTableName[Current])
    Your flag = IF([Total current]>[Total last],1,3)

     

     

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    You can try this measure.

     

     

    Measure =

    SWITCH(
    TRUE(),
    MAX('Table'[Last]) < MAX('Table'[Current]) , "3",

    "1"

    )

     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)