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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
v-rouge
Regular Visitor

IF Measure resulting in Yes/No Calculated Column

Hello,

 

I am trying to create a measure with an IF filter resulting in a Yes/No column but keep coming up to problems. 

 

I have two columns where if the value in Column 1 is greater than the value in Column 2 it will result in a Yes answer so that I can include it in a Slicer visual.

 

So far the measure I have is:

 

Measure 1 = IF('Table),[Column1]>[Column 2])"Yes","No"

 

but that comes up with errors even with every type of punctuation variation. 

 

Any help would be appreciated.

Thanks in advance

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@v-rouge 
To create a if measure, you need to add a aggregation function for the columns (sum, max or min).

Measure = IF(SUM('Table'[Column1])>SUM('Table'[Column2]),"YES","NO")

YesNO.JPG

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@v-rouge 
To create a if measure, you need to add a aggregation function for the columns (sum, max or min).

Measure = IF(SUM('Table'[Column1])>SUM('Table'[Column2]),"YES","NO")

YesNO.JPG

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

Anonymous
Not applicable

Try this

Measure 1 = IF(SELECTEDVALUE('Table'[Column1])>SELECTEDVALUE('Table'[Column 2]),"Yes","No")

 

Many thanks for responding @VikramBasriyar

The measure is correct (in that there are no errors) but all results still come up as No even though I know that some should be Yes.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.