Forum Discussion
Set default data based on specific rule filter
- 4 years ago
After trying several times,
when using your measure, it's actually correct. but there is a little bug when using isfiltered. isfiltered will return true when nothing is selected (don't know how).
I finally combined your measure with measure I've made and make some changes.Measure :
Filtered Type =IF(CALCULATE(ISFILTERED(Table_A[Type]), ALLSELECTED(Table_A[Type])),CALCULATE(SUM(Table_A[Value]),ALLSELECTED(Table_A[Type])),CALCULATE(SUM(Table_A[Value]),FILTER(Table_A, Table_A[Type] in ALLSELECTED(Table_B[Type]) )))Thanks amitchandak
gzai , Try like
Filtered Type = if(ISFILTERED(Table_A[Type]) , CALCULATE(count(Table_A[Type]), ALLSELECTED(Table_A[Type])) ,
CALCULATE(count(Table_A[Type]), filter(Table_A , Table_A[Type] in allselected(Table_B[Type]))) )
amitchandak measure no error, but it seems for else logic is not correct.
Visual chart when no selected filter :
Total Value = 62 ( 10 (A) + 15 (B) + 8 (A) + 5 (C) + 13 (D) + 4 (E) + 7 (F) )
expected results when no selected filter :
Total Value = 24 ( 15 (B) + 5 (C) + 4 (E) )