Forum Discussion

EDDYYC's avatar
EDDYYC
Frequent Visitor
5 years ago

Variable change

Hi guys,

 

Hoping you can help me out with this, i have two tables, one table contains the dates where a product was tested, the other table daily operations, 

 

tested:

 

and the daily production:

 

 

i am having issues with the following task, as you can see in the daily prod table there is a _Log date measure, the logic is the first value of the first table is 2021-05-26, so everything equal or above that day performs a calculation, now what i need now is once the date is equal to that date then the variable will change it is value to the next day in the testing table which is 2021-05-19, so everything above the 19 but below the 26th performs a different actions, here an example of the desired result:

 

 

i tried this but not success:

 

_Log Date =
VAR _LOG = CALCULATE( MAX( 'Rod Pumps'[Log Date]))
RETURN SWITCH(TRUE(),
_LOG >= [_last test], [_New Pump Eff],
_LOG = CALCULATE( MAX( 'Well tests ALL (PVUNITCOMPTEST)'[Testing Date]), FILTER('Well tests ALL (PVUNITCOMPTEST)', 'Well tests ALL (PVUNITCOMPTEST)'[Testing Date] < _LOG)))

1 Reply

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi EDDYYC ,

    In your formula, what's the [_last test] and [_New Pump Eff]] look like?

    In addition, what's the actual expected result in your visual instead of 1,2,3.. ?

    Could you please consider sharing more details about this issue for further discussion so that members in the community could help you better.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.