Forum Discussion
Anonymous
5 years agoNot applicable
PowerBi Table & Measure Issue
Hello im having the same issue again i tried the measure codes numerous times but still unable to change "Or" condition to "And" condition so that my table does not show blank spaces. can anyone assi...
Anonymous
5 years agoNot applicable
Hello sorry for the confusion currently i have a problem with my table as shown below the image i do not want to have blank spaces in my "Table". I noticed that my condition has been set to "OR" how can i change it to "AND" condition if possible assist me with the formula / code for me to solve this issue. Expected result is to select multiple subjects and not show any blanks in my table .
Anonymous
5 years agoNot applicable
// T is your table and stores all fields.
// No other tables in the model are
// present. If this is not the case,
// you'll have to adjust the code.
[Name Has All Selected Subjects] =
// Returns 1 if the currently visible name
// does have all the subjects selected,
// and 0 if not.
var __oneNameIsVisible = HASONEFILTER( T[Name] )
var __result =
if( __oneNameIsVisible,
var __allSelectedSubjects =
CALCULATETABLE(
VALUES( T[Subject] ),
ALLSELECTED( T )
)
var __subjectCount =
COUNTROWS( __allSelectedSubjects )
var __nameHasAllSelectedSubjects =
// When we remove the current
// filter on Subject and apply
// __allSelectedSubjects,
// we should get the same number
// of subjects as __subjectCount.
CALCULATE(
1 * (__subjectCount
= DISTINCTCOUNT( T[Subject] )
),
__allSelectedSubjects
)
return
__nameHasAllSelectedSubjects
)
return
__result
- Anonymous5 years agoNot applicable
Hello i have tried your code it seems to work but it still does not remove the blanks when i select multiple subjects please refer to image MEASURE CODEPROBLEM WITH TABLE SHOWING BLANKS
- Anonymous5 years agoNot applicableHave you filtered your visual by the measure in the Filters pane? This is where you should use this measure...