This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
Need help in setting up a measure that counts the number of rows that have a date that is selected in a slicer.
I used these measures:
SelectedDate = selectedvalue('Complaints Raw Data'[Date Received]) //to store the date selected in the measure
Hi,
Create a Calendar table and have a *:1 relationship from the Date received column to the Calendar table. To your slicer, drag the Date from the Calendar table. Write this measure
Volume = count('Complaints Raw Data'[short_id])
Hope this helps.
The fix is to move the SELECTEDVALUE inside the measure using a VAR:
Volume =
VAR _SelectedDate =
SELECTEDVALUE ( 'Complaints Raw Data'[Date Received] )
RETURN
CALCULATE (
COUNT ( 'Complaints Raw Data'[short_id] ),
'Complaints Raw Data'[Date Received] = _SelectedDate
)
Hi @rogelep
Why do you need to use a filtered measure when you're using the same column from the same table? You could simply use 'Complaints Raw Data'[Date Received] in a slicer and count('Complaints Raw Data'[short_id]) in a measure.
Hi @rogelep,
Try below DAX
Volume =
VAR SelectedDt =
SELECTEDVALUE(
'Complaints Raw Data'[Date Received]
)
RETURN
CALCULATE(
COUNT('Complaints Raw Data'[short_id]),
FILTER(
ALL('Complaints Raw Data'),
'Complaints Raw Data'[Date Received] = SelectedDt
)
)
OR
Volume =
VAR SelectedDt =
SELECTEDVALUE(
'Complaints Raw Data'[Date Received]
)
RETURN
CALCULATE(
COUNT('Complaints Raw Data'[short_id]),
TREATAS(
{SelectedDt},
'Complaints Raw Data'[Date Received]
)
)
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi,
The error occurs because CALCULATE's filter arguments must be Boolean column expressions or table expressions — you cannot directly reference a measure (like [SelectedDate]) inside a filter predicate. DAX doesn't allow Column = Measure as a direct filter argument.
Volume =
CALCULATE(
COUNT('Complaints Raw Data'[short_id]),
FILTER(
'Complaints Raw Data',
'Complaints Raw Data'[Date Received] = [SelectedDate]
)
)
====
FILTER() returns a table, which CALCULATE accepts. Inside FILTER, the row-by-row evaluation resolves the measure correctly.
Hope this gets you moving in the right direction! If it solved your problem, hitting 'Mark as Solution' helps others find the answer faster. Kudos are always appreciated too — they go a long way in keeping this community thriving.
I'm always happy to help. Don't hesitate to reach out if you have more questions!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 31 | |
| 23 | |
| 15 |
| User | Count |
|---|---|
| 74 | |
| 58 | |
| 31 | |
| 31 | |
| 23 |