cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
siddrow
Helper II
Helper II

How to do <100% in custom column

Hi

 

I've tried the below, however it isnt working. The status column is text type and the % complete is % (see below screenshot). I basically want to say if the status column is "Status" and the % completed column is less than 100% then "Discrepancy"

 

if [Status]="Completed" and [#"% Complete"] <1 then "Discrepancy"

else if [Status]="In Progress" and [#"% Complete"]=1 then "Discrepancy"

else if [Status]="Overdue" and [#"% Complete"]=1 then "Discrepancy"

else if [Status]="Not Started" and [#"% Complete"]=1 then "Discrepancy"

else "")

 

siddrow_0-1655336207554.png

 

thank you in advance

 

1 ACCEPTED SOLUTION

Sorry, I didn't include my whole formula initially. This is it below - so the ) wasn't the issue. The <1.0 worked and is bringing through the correct info now. I found the fix on another PBI post.

 

= Table.AddColumn(#"Added Conditional Column6", "Status completed & % complete not 100%", each if [Status]="Completed" and [#"% Complete"] <1.0 then "Discrepancy"
else if [Status]="In Progress" and [#"% Complete"]=1.0 then "Discrepancy"
else if [Status]="Overdue" and [#"% Complete"]=1.0 then "Discrepancy"
else if [Status]="Not Started" and [#"% Complete"]=1.0 then "Discrepancy"
else "")

View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @siddrow 

 

Download example PBIX file

 

How exactly is it not working?

 

The only problem I can find is that you don't need a closing parenthesis )

 

This code works for me

 

if [Status]="Completed" and [#"% Complete"] <1 then "Discrepancy"

else if [Status]="In Progress" and [#"% Complete"]=1 then "Discrepancy"

else if [Status]="Overdue" and [#"% Complete"]=1 then "Discrepancy"

else if [Status]="Not Started" and [#"% Complete"]=1 then "Discrepancy"

else ""

 

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks for the response Phil. I ended up working it out - I had to change the <1 to <1.0 and it fixed it

Hi @siddrow 

 

Changing 1 to 1.0 shouldn't have had bearing on the problem.  If you check my example file you'll see the code works fine using just 1.

You sure the problem wasn't something else, like the ) at the end of the code?

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Sorry, I didn't include my whole formula initially. This is it below - so the ) wasn't the issue. The <1.0 worked and is bringing through the correct info now. I found the fix on another PBI post.

 

= Table.AddColumn(#"Added Conditional Column6", "Status completed & % complete not 100%", each if [Status]="Completed" and [#"% Complete"] <1.0 then "Discrepancy"
else if [Status]="In Progress" and [#"% Complete"]=1.0 then "Discrepancy"
else if [Status]="Overdue" and [#"% Complete"]=1.0 then "Discrepancy"
else if [Status]="Not Started" and [#"% Complete"]=1.0 then "Discrepancy"
else "")

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors