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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Use greater than as a True Result in IF statement

Hi,

 

I'm trying to compare two columns using clustered column chart, and want to make a filter that if I select "yes" then the visual will be filtered into a visual that shows column a more than column b.

 

Is it possible to use greater than as a result in the if statement?

 

For example,

Activity has planned duration and actual duration.

rezagvn_0-1636009036780.png

 

And If I select yes in slicer then the visual will display the actual duration value that exceeds the planned duration, and if I select no it will display the actual duration value which is less than equal to the planned duration.

 

Appreciate your help.

 

Thank you.

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The big question here is if you can do it as a column or if you need a measure.

 

If you can do it as a column then it would be like

 

Greater = If (Actual_Duration>Planned_Duration,"Yes","No")

 

and you would then use that column to feed your slicer.

 

For a measure version you would need to feed the slicer from a disconnected table.

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

To make it more clear, you need create a Calculated column and then use the new column to create Slicer.  Calculated column used to compare ACTUAL_DURATION with PLANNED_DURATION:

GreaterOrNot = If ('DURATION'[ACTUAL_DURATION]>'DURATION'[PLANNED_DURATION],"Yes","No")

 

Test result:

vcazhengmsft_0-1636616984972.png

 

Attached the pbix file as reference.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks a lot!

 

lbendlin
Super User
Super User

The big question here is if you can do it as a column or if you need a measure.

 

If you can do it as a column then it would be like

 

Greater = If (Actual_Duration>Planned_Duration,"Yes","No")

 

and you would then use that column to feed your slicer.

 

For a measure version you would need to feed the slicer from a disconnected table.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.