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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.