Forum Discussion
Why my measure remove external date filter?
I wish to calculate free capacity which is math difference between 100% and Loading, %.
[Loading, %] - is a measure which calculated from inputs file as:
Does this work better?
Free Capacity, % = VAR Loading = [Loading, %] RETURN IF ( ISBLANK ( Loading ), BLANK (), MAX ( 1 - Loading, 0 ) )
6 Replies
- AlexisOlson
Super User
Does this work better?
Free Capacity, % = VAR Loading = [Loading, %] RETURN IF ( ISBLANK ( Loading ), BLANK (), MAX ( 1 - Loading, 0 ) ) - SbezkoroRegular Visitor
I modefied IF function as per my needs and its works, solution is excepted, thanks a lot!!
Now need to understand what was wrong with mine 🙂
- AlexisOlson
Super User
Your original measure always returned a value regardless of date since if [Loading, %] were blank, it would still return 1 - BLANK() = 1.
My measure specified that it should only return something if [Loading, %] is not blank.
- SbezkoroRegular Visitor
and if I need to return 100% if Loading, % is zero or blank in inputs? i'm asking because equation is
Loading, % + Free Capacity, % = 100%
- SbezkoroRegular Visitor
In order to make it work I replaced all nulls with "0" in query (inputs file). It, unfortunatelly increased my dataset, but at least I have now only zeros (no empty) and it works fine.
Thanks!