Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gene
New Member

dax: if count of atleast one true in a group then true

I have a Table Student and the columns are Group and Pass.

I need to create a measure where:

if even one feild in pass is True, then the group should be TRUE else it should be a false.

Screen Shot 2017-12-10 at 12.05.50 PM.png

I have a measure which looks like below which does not seem to give me the write result.

Measure:= if(maxa('Student'[Pass]) = 1, true(),false())
2 ACCEPTED SOLUTIONS
BILASolution
Solution Specialist
Solution Specialist

Hi @gene

 

You could try with this measure....

 

True-False = 
IF
(
	SUMX
	(
		ADDCOLUMNS(Student;"NumPass";IF(Student[Pass];1;0))
		;[NumPass]
	) >= 1 ; TRUE() ; FALSE()
) 

I hope it helps

 

Regards

BILASolution

View solution in original post

@gene

 

Just another way of doing it

 

True-False = CALCULATE(countrows(Student),Student[Pass]=True)>=1

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
BILASolution
Solution Specialist
Solution Specialist

Hi @gene

 

You could try with this measure....

 

True-False = 
IF
(
	SUMX
	(
		ADDCOLUMNS(Student;"NumPass";IF(Student[Pass];1;0))
		;[NumPass]
	) >= 1 ; TRUE() ; FALSE()
) 

I hope it helps

 

Regards

BILASolution

@gene

 

Just another way of doing it

 

True-False = CALCULATE(countrows(Student),Student[Pass]=True)>=1

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.