The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
try this
Status =
IF (
CALCULATE (
COUNTA ( mytable[Yes/No] ),
FILTER ( mytable, mytable[Yes/No] = "Opened" )
) >= 1,
"Opened",
"Closed"
)
Thank you sir! Very helpful!
try this
Status =
IF (
CALCULATE (
COUNTA ( mytable[Yes/No] ),
FILTER ( mytable, mytable[Yes/No] = "Opened" )
) >= 1,
"Opened",
"Closed"
)