Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
Category | Measure1 |
A | N |
A | Y |
A | N |
A | N |
B | N |
B | N |
B | N |
C | N |
C | N |
C | N |
C | Y |
D | N |
D | N |
I'd like to use a measure to check: if even one category has Y, then all of that category is true, else false
For A = True, B = False, C = True, D = False
Thank you for the help
Solved! Go to Solution.
Let me suggest you a different approach then. Write a new measure called Exclude Month_Numerical : IF( MAX(table[Month]) IN ALLSELECTED(sample[Month]) && COUNTROWS(ALLSELECTED(sample[Month])) <> COUNTROWS(ALL(sample[Month])), 1,0)
Basically we are replacing Y/N with binary values that we can add.
Then, write a measure like this:
CategoryY/N = IF(SUMX('Table where "Exclude Month_Numerical" is hosted, [Exclude Month_Numerical]) >= 1, "True", "False")
This way we'll be adding up the results of the measures in each row, since we only deal with 0s and 1s works as if we were counting.
Let me know if it works.
Proud to be a Super User!
I would suggest something like this:
Instead of creating a measure to evaluate the first Y/N, create a conditional column (either on Power Query or as a calculated column) and call it "Yes/No?" Then:
Category Result =
VAR count_result = CALCULATE(COUNT('Table'[Yes/No?]), 'Table'[Yes/No?] = "Y")
RETURN
IF(count_result >= 1, "True", "False")
Then, create a table visual and add Category column and created measure.
Proud to be a Super User!
The first measure is to exclude data that is in the currently selected slicer. I think I need that to be a measure to work properly? Unless.. is there a way to make the first measure also account for the category...?
Here is the extended sample:
Category | Month | Measure1 |
A | May | N |
A | June | Y |
A | July | N |
A | August | N |
B | January | N |
B | March | N |
B | April | N |
C | February | N |
C | March | N |
C | May | N |
C | June | Y |
D | March | N |
D | April | N |
My current measure:
Let me suggest you a different approach then. Write a new measure called Exclude Month_Numerical : IF( MAX(table[Month]) IN ALLSELECTED(sample[Month]) && COUNTROWS(ALLSELECTED(sample[Month])) <> COUNTROWS(ALL(sample[Month])), 1,0)
Basically we are replacing Y/N with binary values that we can add.
Then, write a measure like this:
CategoryY/N = IF(SUMX('Table where "Exclude Month_Numerical" is hosted, [Exclude Month_Numerical]) >= 1, "True", "False")
This way we'll be adding up the results of the measures in each row, since we only deal with 0s and 1s works as if we were counting.
Let me know if it works.
Proud to be a Super User!
That works! Thank you!
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
76 | |
74 | |
69 | |
47 | |
41 |
User | Count |
---|---|
63 | |
42 | |
30 | |
30 | |
28 |