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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

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
Super User
Super User

@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!:
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.

 

Siva554_0-1630948990865.png

 



Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.