Skip to main content
cancel
Showing results for 
Search instead 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

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!:
The Definitive Guide to Power Query (M)

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors