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 moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi all,
I need to create a simple measure that returns the number of rows where the value in a date column falls between two dates. I have had some success, but it only seems to return non-distinct values (for example, if two dates are the same it returns just '1' value). Any help would be greatly appreciated.
Specifically, the measure I want to create goes something like this:
Events in Next 90 Days =
CALCULATE(
DISTINCTCOUNT('Table'[Event]),
DATESBETWEEN('Table'[Due Date],Today(), Today()+90)
))
Here is the table:
| Event | Due Date |
| Event 1 | 15/06/2022 |
| Event 2 | 30/06/2022 |
| Event 3 | 05/07/2022 |
| Event 4 | 15/10/2022 |
| Event 5 | 20/11/2022 |
Solved! Go to Solution.
Hi @Anonymous ,
Which part is wrong? According to your description, just change the distinctcount() to count() and it will be fine.
Events in Next 90 Days =
CALCULATE(
COUNT('Table'[Event]),
DATESBETWEEN('Table'[Due Date],Today(), Today()+90)
))
Best Regards,
Jay
Hi @Anonymous ,
Which part is wrong? According to your description, just change the distinctcount() to count() and it will be fine.
Events in Next 90 Days =
CALCULATE(
COUNT('Table'[Event]),
DATESBETWEEN('Table'[Due Date],Today(), Today()+90)
))
Best Regards,
Jay
I've tried that, and literally everything else, but nothing is working sadly.
Hello
Try to use countrows instad of distinctcount
I did manage to get this working, but it only includes one filter: if the date is in the past. What I need is for this simple measure to include an additional time-based filter so that I can target all values that fall between two dates:
Risks Overdue =
CALCULATE(COUNT(Table[Event]),
FILTER(Table,Table[Event].[Date] < Today() ))
ok. Try this as measure
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 55 | |
| 31 | |
| 24 | |
| 23 |