Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
M_SBS_6
Helper V
Helper V

IF statement using Measures

Hi, 

 

I have 2 measures (apps_val and comps_val) of which I need to create a text output on based on the following logic. How would I correctly write this out please? 

 

If apps_val > comps_val and comps_val > 0 then "uplift" else 

If apps_val < comps_val and apps_val <>0 then "not required" else 

If apps_val > 0 and comps_val is blank then "test"

 

1 ACCEPTED SOLUTION
ddpl
Solution Sage
Solution Sage

Measure = If([apps_val] > [comps_val] && [comps_val] > 0 , "uplift", 

If [apps_val] < [comps_val] && [apps_val] <>0 , "not required",

If [apps_val] > 0 && [comps_val] ==BLANK(), "test",0)

View solution in original post

3 REPLIES 3
Alf94
Solution Supplier
Solution Supplier

Hi @M_SBS_6 ,

 

You can try the following:

 

Comparison =
SWITCH(
    TRUE(),
    AND([apps_val] > [comps_val], [comps_val] > 0), "uplift",
    AND([apps_val] < [comps_val], [apps_val] <> 0), "not required",
    AND([apps_val] > 0, ISBLANK([comps_val])), "test"
)

 

If I answered your question, please mark my post as a solution.

 

Best,

ddpl
Solution Sage
Solution Sage

Measure = If([apps_val] > [comps_val] && [comps_val] > 0 , "uplift", 

If [apps_val] < [comps_val] && [apps_val] <>0 , "not required",

If [apps_val] > 0 && [comps_val] ==BLANK(), "test",0)
Syndicate_Admin
Administrator
Administrator

Algo igual o similiar a esto:

Salida = if apps_val > comps_val and comps_val > 0 then
"elevar más"
else if apps_val < comps_val and apps_val <> 0 then
"no es necesario"
else if apps_val > 0 and comps_val = null then
"prueba"
else
"otra salida"

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors