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
CEB
Frequent Visitor

If formula based on date range

I have a column with a value that I need to override to zero if the date falls outside a 45 day range starting from today. Right now it only works with today’s date. Is there some way I can get it to work with a range?

 

 

Column = IF(Append1[Date]=TODAY(),Append1[Volume This Period],0)

 

I originally tried using a measure with a date slicer, but the totals don't calulate correctly in the matrix. 

 

Measure Vol = IF((count('Append1'[Date]))<1,"0",(SUM('Schedule Data Entry'[Volume This Period])))

 Any help would be grand?

 

 

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

I am assuming it's 45 days forward from today

Measure:

Measure=
VAR StartDate = TODAY()
VAR EndDate = StartDate + 45
RETURN
CALCULATE(SUM(Append1[Volume This Period]),DATESBETWEEN(Append1[Date],StartDate,EndDate))

Column:

Column=
VAR StartDate = TODAY()
VAR EndDate = StartDate + 45
RETURN
IF(AND('Append1'[Date]>=StartDate,Append1[Date]<=EndDate),Append1[Volume This Period],0)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

I am assuming it's 45 days forward from today

Measure:

Measure=
VAR StartDate = TODAY()
VAR EndDate = StartDate + 45
RETURN
CALCULATE(SUM(Append1[Volume This Period]),DATESBETWEEN(Append1[Date],StartDate,EndDate))

Column:

Column=
VAR StartDate = TODAY()
VAR EndDate = StartDate + 45
RETURN
IF(AND('Append1'[Date]>=StartDate,Append1[Date]<=EndDate),Append1[Volume This Period],0)


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

CEB
Frequent Visitor

Thanks for your help Stachu! I will give these a try in the morning.  

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.