Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Good day, everyone. Hoping someone can help me w/some DAX.
I need to count values if their date is -/+ 3-days from the activity date.
Here's what I'm using, but it is not as accurate as it needs to be:
QuoteTest =
VAR selectedMin =
FIRSTDATE ( ALLSELECTED ( CRMDetails[ActivityDate] ) )
VAR selectedMax =
LASTDATE ( ALLSELECTED ( CRMDetails[ActivityDate3] ) )
RETURN
CALCULATE (
DISTINCTCOUNT ( CRMDetails[AgentID] ),
FILTER (
ALL ( QMFact ),
[DateQuoted] >= selectedMin
&& [DateQuoted] <= selectedMax
)
)
Without creating a calculated column, is there a way to do this in DAX?
Hello @jcampbell474
You may try this:
Count within 3 Days =
VAR _Duration = 3
VAR _StartDate = _SelectDate - _Duration
VAR _EndDate = _SelectDate + _Duration
VAR _Filter =
FILTER(
ALLSELECTED(dtTable[Order Date]),
dtTable[Order Date] >= _StartDate
&& dtTable[Order Date] <= _EndDate
)
VAR _Count =
CALCULATE(
[Distinct Orders],
_Filter
)
RETURN
_Count
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
11 | |
10 | |
10 |