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 agoCan you change the last two measures in the image to the SUMX measures and post the screenshot?
Also, which table is the Sales Rep field in the visual coming from and which field are you using in the SUMX measures?
Avivek
Post Partisan
3 years agoAll the measures will be as below:
Correct Return Temp =
VAR _ReturnDate=
IF(
ISBLANK(MAX('Case Order Fact'[Act Return Date])),
TODAY(),
MAX('Case Order Fact'[Act Return Date])
)
VAR _Diff=
DATEDIFF(MAX('Case Order Fact'[Expected Return Date]),_ReturnDate,DAY)
RETURN
SWITCH(
TRUE(),
ISBLANK(MAX('Case Order Fact'[Expected Return Date])),BLANK(),
_Diff<0,1,
0)
Correct return = SUMX('Case Order Fact',[Correct Return Temp])
Late Return Temp =
VAR _ReturnDate=
IF(
ISBLANK(MAX('Case Order Fact'[Act Return Date])),
TODAY(),
MAX('Case Order Fact'[Act Return Date])
)
VAR _Diff=
DATEDIFF(MAX('Case Order Fact'[Expected Return Date]),_ReturnDate,DAY)
RETURN
SWITCH(
TRUE(),
ISBLANK(MAX('Case Order Fact'[Expected Return Date])),BLANK(),
_Diff>0,1,
0
)
Late return =
SUMX('Case Detail Fact',[Late Return Temp])
% Late Returns =
IF(
ISINSCOPE('Case Order Fact'[CREATED_NAME]),
BLANK(),
DIVIDE([Late return],[Correct return]+[Late return])
)