Forum Discussion
Please help me on calculate function
Hi,
I need to implement the below logic in DAX :
If (LW_SEND_END_DATE_TIME is not NULL) and (LW_SEND_START_DATE_TIME is not NULL) and DOCUMENT_ERROR_STEP not Like "%SEND%" ) then AVG (LW_SEND_END_DATE_TIME - LW_SEND_START_DATE_TIME)
and I am very new at Power BI, can anyone help me on this?
3 Replies
- AlBCommunity Champion
Hi Anonymous,
For an accurate response you need to show the tables in your data model involved in the calculation and explain what each element in your formula is. Without that information, i would venture this:
IF(NOT ISBLANK(LW_SEND_END_DATE_TIME) && NOT ISBLANK(LW_SEND_START_DATE_TIME) && DOCUMENT_ERROR_STEP<>"%SEND%", AVERAGE (LW_SEND_END_DATE_TIME - LW_SEND_START_DATE_TIME))
I'm not clear on the red part because I need the explanation mentioned above.
Please read through these posting tips (particularly the bits in red). By following them, you will increase the probability of getting your questions answered quickly and you will make things much easier for people trying to help.
- v-chuncz-msftCommunity Support
- mussaendaCommunity Champion
FILTER =
VAR ENDSTART = LW_SEND_END_DATE_TIME - LW_SEND_START_DATE_TIME RETURN IF (LW_SEND_END_DATE_TIME <> BLANK() && LW_SEND_START_DATE_TIME <> BLANK() && DOCUMENT_ERROR_STEP <> "%SEND%" , CALCULATE( AVERAGE(ENDSTART)))Maybe something like this?