Forum Discussion
Issue with ISSELECTED function to detect values selected
- 6 years ago
Anonymous sorry to hear that's not working.
The logic works in a test model I built, so I guess there is something specific to your model that is stopping the [Week Check] measure working.
Could you post a link to a santised PBIX that exhibits the problem?
Hi Anonymous
You could use ISFILTERED instead, to detect whether any filters are applied to the columns of interest:
Week Check =
SWITCH (
TRUE (),
ISFILTERED ( DIM_WeekK[WK] ), 1,
ISFILTERED ( DIM_Month[Month] ), 2,
ISFILTERED ( DIM_Month[Quarter] ), 3,
ISFILTERED ( DIM_Month[Year] ), 4
)
Also, you can change the Sales measure slightly (as the condition depends only on the value of [Week Check] and change it so that it evaluates [Week Check] only once:
Sales =
SWITCH (
[Week Check],
1, SUM ( Fact[Col A] ),
2, SUM ( Fact[Col B] )
)
Does that give the intended result?
Regards,
Owen
Thanks for the quick response Owen, I tried doing that change but its still not giving the result I am expecting
When I select 2 weeks from week slicer, I expect the Week check to still stay at 1 , but it shows value where only a single value is selected, in my case if I selecetd 2 values in week, 2 in month and 1 value in Qtr then its showing 3 but I am expecting it to show 1.
- OwenAuger6 years agoSuper User
Anonymous sorry to hear that's not working.
The logic works in a test model I built, so I guess there is something specific to your model that is stopping the [Week Check] measure working.
Could you post a link to a santised PBIX that exhibits the problem?
- Anonymous6 years agoNot applicable
Thanks Owen, I was using a wrong column, its working now.