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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.