Forum Discussion
SelectedValue Question
- Anonymous3 years ago
Hi there.
As you said, i'm trying to get a result from the previus week using the currently week as parameter. The thing is that when the currently week has no value (I dont have any lines with any values, of course, the result for the sum is 0 and also, the parameter that i'm looking is blank) which means that as the measure is looking for the parameter - 1. As the parameter is 0 or blank the result is Measure, filter by something where the result is -1.
Example:
CALCULATE([MEASURE], Number Week = Week - 1 (As the week is blank or 0, the result will always be -1).The way the I found to solve it right now is create another table with all the posibles weeks and also create a Primary Key with Week&Market (is this case market is COSA, LATAM and ROW). And with that I will always have a week number and the measure will work just fine.
But, I dont know if this is the best way. Unfortunetly was the way that i found to fix the problem that i had.
Regards,
Hi Anonymous ,
Based on your description, it seems that you are trying to get the sum of the values of a term from the previous week of the current week? So what should the result be when it doesn't have the previous week?
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi there.
As you said, i'm trying to get a result from the previus week using the currently week as parameter. The thing is that when the currently week has no value (I dont have any lines with any values, of course, the result for the sum is 0 and also, the parameter that i'm looking is blank) which means that as the measure is looking for the parameter - 1. As the parameter is 0 or blank the result is Measure, filter by something where the result is -1.
Example:
CALCULATE([MEASURE], Number Week = Week - 1 (As the week is blank or 0, the result will always be -1).
The way the I found to solve it right now is create another table with all the posibles weeks and also create a Primary Key with Week&Market (is this case market is COSA, LATAM and ROW). And with that I will always have a week number and the measure will work just fine.
But, I dont know if this is the best way. Unfortunetly was the way that i found to fix the problem that i had.
Regards,