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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
afmcjarre
Helper I
Helper I

How to Use Greater Than and Less Than in DAX Measure

I am really struggling how to properly create a measure just to create a simple measure to check row by row if a number is greater than or less 5.

 

I can't use "IF" because I get the error message about a single value, which I honestly don't understand.  

 

afmcjarre_0-1620664288941.png

 

As someone who mainly uses Power Query or calculated columns, I'm trying to figure out how to use DAX measures more.  But this same error really has me stuck!

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @afmcjarre 

I assume you want to create a new column.

please try the below formula for creating a new column.

 

New column =
IF (
CALCULATE ( SUM ( revisions_max_properties[Expiration-Inception] ) ) > 5,
TRUE,
FALSE
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

dkaushik
Resolver II
Resolver II

In that case, you can add a calculated column, either in DAX or power query editor.

 

For DAX,

 

Column = if(column_name > 5, "True", "False")

dkaushik_0-1620666625401.png

 

Seel below article to know more about this:
Using calculated columns in Power BI Desktop - Power BI | Microsoft Docs

 

Thanks,

Dheeraj

View solution in original post

5 REPLIES 5
dkaushik
Resolver II
Resolver II

In that case, you can add a calculated column, either in DAX or power query editor.

 

For DAX,

 

Column = if(column_name > 5, "True", "False")

dkaushik_0-1620666625401.png

 

Seel below article to know more about this:
Using calculated columns in Power BI Desktop - Power BI | Microsoft Docs

 

Thanks,

Dheeraj

Okay perfect - thank you! I had done this already, just thought this could also be accomplished with a measure. Glad to know I was headed in the right direction. 

Jihwan_Kim
Super User
Super User

Hi, @afmcjarre 

I assume you want to create a new column.

please try the below formula for creating a new column.

 

New column =
IF (
CALCULATE ( SUM ( revisions_max_properties[Expiration-Inception] ) ) > 5,
TRUE,
FALSE
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

dkaushik
Resolver II
Resolver II

Hi @afmcjarre ,

 

Create a Measure as shown below and it will work just fine.

dkaushik_0-1620665053325.png

Regards,

Dheeraj

 

#Please mark as solution and give a big thumbs up if this helps.

 

Unfortunately SUM nor SUMX will work for this because that only gives me one result. I need a result for each row that can then be used in a final calulation. 

afmcjarre_0-1620666033808.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.