Forum Discussion
Avivek
Post Partisan
3 years agoNeed help with the dax
Hello everyone! Recently I have created a report based on an excel which has few calculations. The calculations in the excel are as below: Sales Rep Expected Return Date Act Return Date Ac...
- 3 years ago
Add the Request ID field to the visual and you will see why the values are "different "
PaulDBrown
Community Champion
3 years agoTry with the following measures:
CORRECT Return Temp =
VAR _ReturnDate =
IF (
ISBLANK ( MAX ( fTable[Act Return Date] ) ),
TODAY (),
MAX ( fTable[Act Return Date] )
)
VAR _Diff =
DATEDIFF ( MAX ( fTable[Expected Return Date] ), _ReturnDate, DAY )
RETURN
SWITCH (
TRUE (),
ISBLANK ( MAX ( fTable[Expected Return Date] ) ), BLANK (),
_Diff < 0, 1,
0
)
Correct return =
SUMX(fTable, [CORRECT Return Temp])LATE Return Temp =
VAR _ReturnDate =
IF (
ISBLANK ( MAX ( fTable[Act Return Date] ) ),
TODAY (),
MAX ( fTable[Act Return Date] )
)
VAR _Diff =
DATEDIFF ( MAX ( fTable[Expected Return Date] ), _ReturnDate, DAY )
RETURN
SWITCH (
TRUE (),
ISBLANK ( MAX ( fTable[Expected Return Date] ) ), BLANK (),
_Diff > 0, 1,
0
)
Late return =
SUMX(fTable, [LATE Return Temp])% Late returns =
IF (
ISINSCOPE ( fTable[Sales Rep] ),
BLANK (),
DIVIDE ( [Late return], [Correct return] + [Late return] )
)
- Avivek3 years ago
Post Partisan
PaulDBrown, it works only in few cases and doesn't work in most of the cases, one example is below
I
It should ne showing 60% but it shows 35.71%, can you suggest something else because i am unable to understand what is the error.
- PaulDBrown3 years ago
Community Champion
What is the code for the % Late returns measure?
- Avivek3 years ago
Post Partisan
PaulDBrown Its same what you had shared
% Late Returns =IF(ISINSCOPE('Case Order Fact'[CREATED_NAME]),BLANK(),DIVIDE([Late return],[Correct return]+[Late return]))