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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DAX - Substraction

Dear all,

 

I'm looking to Subtract the "MAX" from the "MIN" but excluding "0" otherwise I can't calculate the sum of the kilometres driven during a period. If someone has an idea it would be highly appreciated. I thought maybe to work with an "IF" formula but I'm not sure if this would be the way to go. Also I can't put a filter on "Kilometerstand" as I have other columns with values which would disapear.

 

Thanks in advance for your support.

 

ExampleExample

MeasureMeasure

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _maxvalue=MAXX(ALL('Table'),[Kilometerstand])
var _minvalue=MinX(FILTER(ALL('Table'),[Kilometerstand]<>0),[Kilometerstand])
return
_maxvalue- _minvalue

2. Result:

vyangliumsft_0-1666923897725.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of your PBI file and show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _maxvalue=MAXX(ALL('Table'),[Kilometerstand])
var _minvalue=MinX(FILTER(ALL('Table'),[Kilometerstand]<>0),[Kilometerstand])
return
_maxvalue- _minvalue

2. Result:

vyangliumsft_0-1666923897725.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors