Forum Discussion
[dax] subtotal wrong - need help with context filter
Hello guys,
I have a matrix that shows wrong subtotals, I believe it's because of the context filters but I don't really get what I should change.
I have 2 tables : Calendar table & Fact table ( 1:* relationship on day )
My fact table contains the number of sales made hourly.
I'm trying to do a prediction with a rolling average, I created this measure :
2 Replies
- AnonymousNot applicable
Hi KanisleS ,
Do you mean that when you drill down to hour level, you will get incorrect result from measure? Is is part in screenshot incorrect? I couldn't see subtotal to this level in your screenshot. I think you can try
IF() and ISINSCOPE() function to calcualte in different hierarchy levels.I think your calculate is based on your data model. Please share a sample file with me and show me a screenshot with the result you want. This will make it easier for me to find the solution.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- KanisleSHelper I
Anonymous Thanks for your answer.
I made a pbix sample file with randomized data : file
In the matrix with good/bad columns, if i drill down to hours and days the values are correct but the weekly values are wrong because they aren't the sum of the daily values, I want to fix that problem, the Total is also wrong since it doesn't compute the total sum of good/bad..
exemple week 2021s13 : Good should be equal to 10+7+11+12+9+13+11
I don't know where resides the problem, please let me know if you have an idea.
thanks!