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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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