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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Formula returning Incorrect result

Can anyone explain why am I getting an incorrect result in some of the rows (Progress_Status_V_Baseline) like the one highlighted (row 59)? 

Any sugestion of how to fix it, as I am then getting wrong % when analysing the data.

 

Thanks guys

 

VS9_1-1647861104150.png

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Please try this code. Use Number.RoundDown or Number.Round to round the result of ([Improvement]+[Baseline_ToFill]) to have a specifc decimal digits. Based on my test, specifying the digits number to 1/2/3/4/... will all bring you the correct result. 

= Table.AddColumn(#"Added Custom", "Custom.1", each if [Value] = -1 then "-" else if [Value] < Number.RoundDown([Improvement]+[Baseline_ToFill],1) then "Below" else "Meet or Above")

vjingzhang_0-1648800225568.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

9 REPLIES 9
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Can you share the calculation you're using to generate the [Progress_Status_V_Baseline] column please?

Your screenshot only shows the [Progress_Status_V_Target] calculation.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Hi @BA_Pete = Table.AddColumn(#"Filtered Rows", "Progress_Status_V_Baseline", each if ([Value] = -1) then ("-") else if ([Value] < ([Baseline_ToFill] + [Improvement])) then ("Below") else ("Meet or Above"), type text)

Hi @Anonymous ,

 

I see your point, that is a bit odd.

 

Maybe try flipping the calculation to see if that helps?

if [Value] = -1 then "-"
else if [Value] >= [Baseline_ToFill] + [Improvement] then "Meet or Above"
else "Below"

 

FYI, you don't need all those brackets in your code. The if..then..else keywords split everything out correctly for you.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

I`ve tried to flip it but I`m getting the same result...

Your result seems correct, as 9.6 is <= 10.2 and should result in "Below". What is the issue?

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi @mahoneypat sorry, I was showing the wrong step in the 1st screenshot.

 

VS9_0-1647982475202.png

 

Hi @Anonymous 

 

Please try this code. Use Number.RoundDown or Number.Round to round the result of ([Improvement]+[Baseline_ToFill]) to have a specifc decimal digits. Based on my test, specifying the digits number to 1/2/3/4/... will all bring you the correct result. 

= Table.AddColumn(#"Added Custom", "Custom.1", each if [Value] = -1 then "-" else if [Value] < Number.RoundDown([Improvement]+[Baseline_ToFill],1) then "Below" else "Meet or Above")

vjingzhang_0-1648800225568.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

It works, thank you for you help!

I don't have an explanation for why you are seeing that. Can you share the whole query from the Advanced Editor, so we can see the steps prior to this one?

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors