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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
uif19085
Helper III
Helper III

Earlier ID with filters

Hello i need some help in creating a column that identifies an "req"
Identification criteria = Type in {"req"} and Compliance in {"Yes","#TBD#"}
but i want to flag it only for the first apperence of the UniqueID


ID UniqueID Type Compliance Req(Flag)
1       aa          req        No              0
2       bb         eer        Yes              0
3       cc          her      #TBD#          0
4      dd          req        Yes             1
4      dd          req        Yes             0
4      dd          req        Yes             0
7     ss            eer         No             0
8     ff            req       #TBD#         1
8    ff             req       #TBD#         0


I thought of something like this:

Req(Flag) =
VAR _Type = IF(Table1[Type] in {"req"},1,0)
VAR _Compliance = IF(Table[Compliance] in {"Yes", "#TBD#"},1,0)
VAR _UniqueID = ??
RETURN IF(_Type && _Compliance && _UniqueId,1,0)

I know that EARLIER function might be a solution but couldn't find something that works and
 i'm not sure if i'm using it corectly.
Also, the rows contains diffrent information too and i can't just remove the others
Can anybody help me, please?

2 REPLIES 2
amitchandak
Super User
Super User

@uif19085 , this seems like simple, unless you want the same flag for id

 

If([Type] in {"req"} && [Compliance] in {"Yes","#TBD#"},1,0)

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak The VAR _UniqueID is the one that i need. If im not using this filter the table would look like this: 
ID UniqueID Type Compliance Req(Flag)
1       aa          req        No              0
2       bb         eer        Yes              0
3       cc          her      #TBD#          0
4      dd          req        Yes             1
4      dd          req        Yes             1
4      dd          req        Yes             1
5     ss            eer         No             0
8     ff            req       #TBD#         1
8    ff             req       #TBD#         1
Even the normal ID it repeats i forgot this detail

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors