Forum Discussion
exclude null/blanks when subtracting
Hello,
I have grouped some data together which includes the following:
Company name
Client ID
Double up
Double up min time
Double Up max time
I am now trying to subtract the Max and Min columns but ignoring any columns that are blank/nulls in the double up min time and double up max time however my formula doesn't appear to be working. Please could I have some assistance please.
My formula is:
IF (ISBLANK( [Double up MIN Time] ), BLANK(),
[max] - [min]))
What if we try it like this?
Column 1 = ABS ( IF ( 'Doubleup test (2)'[Double up Max Time] = "" || 'Doubleup test (2)'[Double up MIN Time] = "", BLANK (), 'Doubleup test (2)'[Max] - 'Doubleup test (2)'[Min] ) )
4 Replies
- jdbuchanan71Super User
What if we try it like this?
Column 1 = ABS ( IF ( 'Doubleup test (2)'[Double up Max Time] = "" || 'Doubleup test (2)'[Double up MIN Time] = "", BLANK (), 'Doubleup test (2)'[Max] - 'Doubleup test (2)'[Min] ) ) - jdbuchanan71Super User
Give this a try, the || is the OR in DAX.
Column 1 = ABS ( IF ( ISBLANK ( 'Doubleup test (2)'[Double up Max Time] ) || ISBLANK ( 'Doubleup test (2)'[Double up MIN Time] ), BLANK (), 'Doubleup test (2)'[Max] - 'Doubleup test (2)'[Min] ) ) - pardeepd84Helper III
Hi jdbuchanan71 ,
I have tried this but it still seems to be calculating the max-min even though the double up min and double up max time columns are empty/null.
I have grouped my data and then created 2 new columns based on actual start time (this is from the original dataset) to get the MIN and MAX values. What I have realised is that the MIN, MAX is still being calculated even if the 'double up MIN time' and 'double up Max TIME' are blank/null.
Is there a way to group data but then only calculate if the cells are blank. My grouped data is as follows:
Please could I have some assistance with working this out.
- pardeepd84Helper III
Thank you jdbuchanan71 , that worked.