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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
SDVN
Helper I
Helper I

Writing a measure to get a single value for repeated rows.

I want to create a table visual in power BI: subject_id as the first column and "yes/no" column next to it. But each subject has multiple entries(rows) and some rows will have "closed" in the "Yes/no" column and some rows might have "Opened" for a single subject. I want to show only one row per subject id in the table visual and if that sublect has only "Closed" in Yes/no column, the it should be "Closed", if there is a single "Opened" for that subject, it should be "Opened" in the table visual. 

Its more like students pass/fail logic. If the student is passed in all the subject, the status should be "Passed" and if that student is failed in one of the subjects, the status should be "Failed" even though he/she has passed few subjects.

 

I wrote a function:

 

IF(    COUNTROWS(FILTER(mytable, mytable[Yes/No] = "Opened")) > 0,    "Opened",    "Closed")

But in the table visual, its giving all the rows of every subject and not just one row per subject as per the above explained logic. Yes_no.png 

1 ACCEPTED SOLUTION
nilendraFabric
Super User
Super User

 

try this

 


Status =
IF (
CALCULATE (
COUNTA ( mytable[Yes/No] ),
FILTER ( mytable, mytable[Yes/No] = "Opened" )
) >= 1,
"Opened",
"Closed"
)

View solution in original post

2 REPLIES 2
SDVN
Helper I
Helper I

Thank you sir! Very helpful! 

nilendraFabric
Super User
Super User

 

try this

 


Status =
IF (
CALCULATE (
COUNTA ( mytable[Yes/No] ),
FILTER ( mytable, mytable[Yes/No] = "Opened" )
) >= 1,
"Opened",
"Closed"
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors