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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JustinDoh1
Post Prodigy
Post Prodigy

How to select a value using SUMX or row context (to create a Measure)

I am trying to convert this Excel formula into measure.

 

=IF( D4>40, D4-40, 0 )  

 

I know, if I create in Column, it is pretty asimple process.

I am trying to save the disk space by creating a Measure.

 

This is initial approach:

 

Measure =
IF (
      sumx('Table1', Table1'[D4]) > 40,
     sumx('Table1',  Table1'[D4]) - 40,
0
)
 
I thought we could use SUMX as a row context, but I am not sure where I am missing.
 
Thanks for help.
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @JustinDoh1 

If you want to apply this to all rows of D4 column, Try this:

 

Measure =
Var _Value = Max(Table1'[D4])
return
If(_Value>40,_Value-40,0)
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @JustinDoh1 

If you want to apply this to all rows of D4 column, Try this:

 

Measure =
Var _Value = Max(Table1'[D4])
return
If(_Value>40,_Value-40,0)
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.