Forum Discussion
Need help with the dax
- 3 years ago
Add the Request ID field to the visual and you will see why the values are "different "
The measures you have posted are to then calculate the correct totals using SUMX:
Correct return =
SUMX(fTable, [CORRECT Return Temp])
Late return =
SUMX(fTable, [LATE Return Temp])
and finally
% Late returns =
IF (
ISINSCOPE ( fTable[Sales Rep] ),
BLANK (),
DIVIDE ( [Late return], [Correct return] + [Late return] )
)
If you have a Sales Rep Dimension table, you should be using it in the visual (it's more efficient). If so, you need to reference this dimension table in the SUMX measures.
PaulDBrown, this is exactly how we did, sales rep is the created name from the same table Case Order Fact, all the columns in measure are from same table. So am I missing something?
Why is it then not giving the right value?
- PaulDBrown3 years ago
Community Champion
Add the Request ID field to the visual and you will see why the values are "different "
- PaulDBrown3 years ago
Community Champion
Can you post a depiction of the visual with the Correct Return and Late return measures?
It would really help if you could provide a link to a sample PBIX file (you can change any confidential information). It's hard to see the problem otherwise. (since in my test it works...) - Avivek3 years ago
Post Partisan
PaulDBrown, if i pull only those 2 columns and create the measures it seems to work fine but if i pulll all the columns in that view in a table and try the measure it doen't seem to work. I will share the test report from another account.
- NavaneethaRaju3 years ago
Helper IV
PaulDBrown , this is the test report and here those measures does not seem to work. I am unable to undertand why it is so? Can you please help?
- PaulDBrown3 years ago
Community Champion
They do work. In your example, if you look at the detail of the rows in the dataset for the filtered sample, you will see why the SUMX returns a higher value.
The temp measure only looks at the dates in the filter context; the SUMX computes the date calculation row by row and then adds up the result of each row. There are two rows for each Expected Return Date and the Request ID field makes each of the rows unique. So there are 4 rows over which the SUMX calculation is carried out:
Edit to add: Avivek
- Avivek3 years ago
Post Partisan
PaulDBrown,I do not follow exactly what you are trying to say.
Certain places it shows me the correct value and certain places it shows differences in the values.
There are 2 issues to be seen here, firstly late return shows a different value from late return temp and on calculation this should be around 71%.
Firstly the late return is probably summing up the late return and secondly the late % value is also not showing the right value