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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Adeelmushtaq
New Member

Need urgent help. How i can achieve this in Power bi

I have data like below 

 

ID Status

1 Requested

1 Approved

2 Requested

3 Requested

1 Closed

3 Approved

 

i want to add one more column which will add a bit 0/1 in front of each row if that id is approved. like below

 

ID Status isApproved

1 Requested YES

1 Approved YES

2 Requested NO

3 Requested YES

1 Closed YES

4 Requested NO

3 Approved YES

 

Please help. using DAX.

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Status]="Approved"))>0,"Yes","No")

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Status]="Approved"))>0,"Yes","No")

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
camargos88
Community Champion
Community Champion

@Adeelmushtaq ,

 

What logic you want to apply on this new column ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



I want to apply the logice that if id 1 is having approved entry then mark this new column as yes. same for each id.

 

Hi @Adeelmushtaq 

That's not clear.  You have ID's where the Status is not Approved, but they have Yes?

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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