cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Need to check Parent or Not

Hi team,

I need to create a calculate column, to check wheather it is parent or not based on "Sno =0"

if sno =0 with respective Parent Id then "Yes" else "No"

1 ACCEPTED SOLUTION
Microsoft Employee

You can try this column expression.

HasParent =
IF (
CALCULATE (
COUNTROWS ( Table ),
ALLEXCEPT ( Table, Table[ParentID] ),
Table[Sno] = 0
) > 0,
"Yes",
"No"
)

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

3 REPLIES 3
Microsoft Employee

You can try this column expression.

HasParent =
IF (
CALCULATE (
COUNTROWS ( Table ),
ALLEXCEPT ( Table, Table[ParentID] ),
Table[Sno] = 0
) > 0,
"Yes",
"No"
)

Pat

Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

Super User

@Anonymous Column = IF([Sno]=0,"Yes","No")   ?

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

NO.

1.Consider with Parent ID , Sno =0, then it is parent.

2. If Sno<>0 then it is not parent.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.