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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AllanBerces
Post Prodigy
Post Prodigy

IF Negative value

Hi good day can someone help me on my calculated column or can i do the same in PQ.
 - IF the Progress is Negative and the Work % equal to 100 then used the Plan value, IF the Work % is not equal to 100 then copy the Progress value

 

AllanBerces_0-1749086199625.png

RESULT

AllanBerces_1-1749086398323.png

 

Thank you

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @AllanBerces 
You can add custom column with the formula :
if [Progress]<0 and [#"Work %"]=100 then [Plan]
else [Progress]

Ritaf1983_0-1749089163412.png

Please note :
You don't need a column if the goal is to put the calculation in visualization, you can just create a measure like :

test measure =

if( max('Table'[Progress])<0 && max('Table'[Work %])=100,sum('Table'[Plan]),sum('Table'[Progress]))

More information about differenses between calculated columns vs measures here :
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.


The pbix with the example is attached

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

@AllanBerces 

you can try this

 

= if [Progress]<0 and [#"Work%"]=100 then [Plan] else if [#"Work%"] = 100 then [Progress] else if [#"Work%"]=0 then [Plan] else [Progress]

 

11.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Hi again , then the formula will be :
PQ:

You can add custom column with the formula :
if [Work%]<0 =0 then [Plan]
else [Progress]

 Dax :

Test measure =

if( max('Table'[Work %])=0,sum('Table'[Plan]),sum('Table'[Progress]))

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi @AllanBerces 
You can add custom column with the formula :
if [Progress]<0 and [#"Work %"]=100 then [Plan]
else [Progress]

Ritaf1983_0-1749089163412.png

Please note :
You don't need a column if the goal is to put the calculation in visualization, you can just create a measure like :

test measure =

if( max('Table'[Progress])<0 && max('Table'[Work %])=100,sum('Table'[Plan]),sum('Table'[Progress]))

More information about differenses between calculated columns vs measures here :
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.


The pbix with the example is attached

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 thank you very much for the reply, a follow up query if i want to add new condition (IF the Work % is equal to 0 then copy the Plan Value else Progress Value). Thank you

Hi again , then the formula will be :
PQ:

You can add custom column with the formula :
if [Work%]<0 =0 then [Plan]
else [Progress]

 Dax :

Test measure =

if( max('Table'[Work %])=0,sum('Table'[Plan]),sum('Table'[Progress]))

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 @ryan_mayu thank you very much for the reply, working as i need.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@AllanBerces 

you can try this

 

= if [Progress]<0 and [#"Work%"]=100 then [Plan] else if [#"Work%"] = 100 then [Progress] else if [#"Work%"]=0 then [Plan] else [Progress]

 

11.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.