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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Ron_Orc
Frequent Visitor

Conditional DAX measure for dates

How do I go about creating a column which counts 1 if the date is less than 7 days, and 0 if its beyond 7 days? 

Ron_Orc_0-1633413444475.png

 

2 REPLIES 2
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Ron_Orc ,

 

Try this measure:

Measure= 
Var Days= DAY(SELECTEDVALUE(Table[Date]))
Return IF(Days <7,1,0)

 

 

Mark this as a solution, if I answered your question. Kudos are always appreciated

Thanks

amitchandak
Super User
Super User

@Ron_Orc , a new column

if(datediff([date], today(),day) <7,1,0)

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.