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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How To calculate the Number of Event on a new column With Reference with Date

I have a date, Code and Number Of Event Column . The Logic is This - WHen You have BB or BV in the Code code Column There should BE "1" on the Number of Event Colum but if we have BB or BV on Two consucative Days WE want to have "1' for the first Day and '0" For the Second Day. Example 
Date| Code|Number Of Event 
1/1/2001| BB| 1
1/2/2001| BB| 0
1/7/2001| BB| 1
1/8/2001| BB| 0
1/12/2001|BB|1
Please How Can I implement this Logic With Dax . I have Tried This IF([Code]="BB",1,0,IF([Code]="BB",1,0)) But It didnt Work

3 REPLIES 3
aj1973
Community Champion
Community Champion

Hi @Anonymous 
Try this

IF([Code]="BB" || [Code]="BV",1,0)

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

Did not Work 

 

aj1973
Community Champion
Community Champion

IF(OR([Code]="BB" ,[Code]="BV"),1,0)

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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 Solution Authors
Top Kudoed Authors