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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
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"

Siva554_0-1630941922768.png

 

 

Thanks in Advance,

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
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!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
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!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

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.

 

Siva554_0-1630948990865.png

 



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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