Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 assist to provide me the measure code for to copy ?
Hello:
I think I've solved your issue as follows: only present those who have all grades when are selected in the attributes
please let me know if it works for you
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 .
// 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
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 CODE
PROBLEM WITH TABLE SHOWING BLANKS
@joeheng123 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.
This thing is rather easy to code but you have to do 2 things to get a good answer:
1) Post the model.
2) Show some example data.
3) Tell exactly what you want to achieve.
4) Best to show what the output should be.
And it looks like some of the above you have already done 🙂
HI @joeheng123 ,
Looks like I am not able to understand the whole issue.
Both the Screenshots for the measures look exactly same - One without error and one with error.
Can you add details please?
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Thanks,
Pragati
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |